# Optimizing Render Times#

Thanks to Physically Based Rendering (PBR) getting photorealistic images hasn't been easier! Complexity is pretty much hidden to users since the renderer can automatically allocate the number of samples based on material and light configurations using complex heuristics that are running under the hood.

While this automatic sampling allocation is great for artists as they tweak their renders using a reduced set of parameters, it may not be the most efficient if we take into account render times.

To optimize render times, artists can use a set of dedicated diagnostics AOVs to help them identify where the path tracer is allocating samples. Combined with the per-channel material AOVs, it becomes simpler to identify the source of the noise and the number of samples per channel to hint the path tracer by increasing the number of samples on appropriate lights and materials/channels to optimize render times.

Note

Diagnostics AOVs are always prefixed by diagnostics so that they can be found under Diagnostics in the AOV Editor

## Ray Count#

The diagnostics_ray-count AOV outputs the total number of ray trace calls in a render. This includes all ray tracing calls whereas they are used for anti aliasing, material/light sampling or textures such as Occlusion texture and OSL scripts calling the trace function.

This AOV is extremely useful to identify which parts of your image are the most ray trace extensive which is a very important information since the more ray trace calls the slower the renders.

AOV Description
diagnostics_ray-count Output the total number of ray trace calls used during rendering. This AOV is displayed as a normalized heat map.

In the diagnostics_ray-count AOV we can clearly see that the red areas which correspond to the pixels that needed the most ray trace call are located on the mirror-like reflective material. This is quite expected because of the amount of inter-reflections.

## Anti Aliasing#

The raytracer provides two dedicated AOVs diagnostics_camera_sample-count and diagnostics_camera_heat-map to help you understand where it has allocated more camera samples when rendering using adaptive antialiasing. These AOVs are extremely useful when optimizing your renders.

AOV Description
diagnostics_camera_sample-count Output the total number of camera samples used during rendering. This AOV is displayed as a normalized heat map.This AOV is only meaningful when texturing anti aliasing samples or using adaptive anti aliasing otherwise it will return a constant value. For more information please refer to Using Adaptive Anti Aliasing.
diagnostics_camera_heat-map Output the number of camera samples normalized using the max refinement sample count set in the path tracer.The AOV is displayed as a heat map. This AOV is only meaningful when texturing anti aliasing samples or using adaptive anti aliasing otherwise it will return a constant value. For more information please refer to Using Adaptive Anti Aliasing.

When viewing the diagnostics_camera_sample-count AOV we can see a blue to red gradient in the AOV. The blue areas correspond to areas that needed the less samples while the red ones correspond to areas that needed the most.

This is very helpful since we can quickly identify the areas of a render that have the most variance.

diagnostics_camera_heat_map AOV helps even further since we can see (in white) where the raytracer reached out the maximum number of anti aliasing samples defined by the user. We easily can see that the raytracer doesn’t have enough samples to reach the specified variance threshold.

If the noise isn't visually acceptable then the course of action is to increase the Refinement Maximum Sample Count to a higher value and/or tweak the per channel sampling multipliers on specific materials and/or increase Shading Oversampling.

## Material#

The materials also provide many AOVs for each type of material channels to help you understand where samples are allocated and where render times go. These set of AOVs are really useful in conjunction with the corresponding per channel material AOVs to identify where the noise comes from and thus where to increase samples.

AOV Description
diagnostics_pbr_diffuse_sample-count Output the number of samples allocated to the diffuse channel (diffuse transmission + diffuse reflection). This AOV is displayed as a normalized heat map.
diagnostics_pbr_diffuse_sample-count_transmission Output the number of samples allocated to diffuse transmission only.This AOV is displayed as a normalized heat map.
diagnostics_pbr_diffuse_sample-count_reflection Output the number of samples allocated to diffuse reflection only.This AOV is displayed as a normalized heat map.
diagnostics_pbr_glossy_sample-count Output the number of samples allocated to the glossy channel (glossy transmission + glossy reflection). This AOV is displayed as a normalized heat map.
diagnostics_pbr_glossy_sample-count_transmission Output the number of samples allocated to glossy transmission only.This AOV is displayed as a normalized heat map.
diagnostics_pbr_glossy_sample-count_reflection Output the number of samples allocated to glossy reflection only.This AOV is displayed as a normalized heat map.
diagnostics_pbr_specular_sample-count Output the number of samples allocated to the specular channel (specular transmission + specular reflection). This AOV is displayed as a normalized heat map.
diagnostics_pbr_specular_sample-count_transmission Output the number of samples allocated to specular transmission only.This AOV is displayed as a normalized heat map.
diagnostics_pbr_specular_sample-count_reflection Output the number of samples allocated to specular reflection only.This AOV is displayed as a normalized heat map.
diagnostics_pbr_spec-gloss_sample-count Output the number of samples allocated to the specular and gloss channel (specular transmission + glossy transmission + specular reflection + glossy reflection). This AOV is displayed as a normalized heat map.
diagnostics_pbr_spec-gloss_sample-count_transmission Output the number of samples allocated to both specular and gloss transmission (specular transmission + glossy transmission). This AOV is displayed as a normalized heat map.
diagnostics_pbr_spec-gloss_sample-count_reflection Output the number of samples allocated to both specular and gloss reflection (specular reflection + glossy reflection).This AOV is displayed as a normalized heat map.
diagnostics_pbr_subsurface_sample-count Output the number of samples allocated to subsurface channel only.This AOV is displayed as a normalized heat map.
diagnostics_pbr_volume_sample-count Output the number of samples allocated to volume channel only.This AOV is displayed as a normalized heat map.

## Light#

The path tracer also provides a dedicated AOV diagnostics_pbr_light_sample-count to help you understand the number of light samples per pixel.

AOV Description
diagnostics_pbr_light_sample-count Output the number of samples allocated to lights sampling.This AOV is displayed as a normalized heat map.