Overview
For information on what physically based rendering is and why you might want to use it, see understanding PBR.
Note
Irradiance caches aren’t supported for PBR.
Using physically based rendering
Physically based rendering is implemented as a rendering engine inside mantra.
Change the Rendering Engine to either Physically Based Rendering or Micropolygon Physically Based Rendering on the Render tab in the parameter editor of a mantra render node.
Render your scene.
Micropolygon Rendering vs. Raytracing
There are two types of rendering in PBR, micropolygon rendering and raytracing. Micropolygon physically based rendering, like micropolygon rendering, decouple the Min Ray Samples from the Pixel Samples, allowing different numbers of motion blur from raytracing samples.
Micropolygon rendering uses the maximum of the Min/Max Ray Samples samples to determine the number of antialiasing samples per micropolygon. Raytracing uses Pixel Samples to do all of these things.
The following in an example of micropolygon PBR with Pixel Samples set to 4×4 and Min Ray Samples set to 16:
The following in an example of raytraced PBR with Pixel Samples set to 4×4:
One of the features of micropolygon rendering is that shading is dragged with the object as it moves. This has the desirable side effect of blurring out noise from the low sampling rate.
See the Render Quality and Performance help for more information.
Micropolygon renderer does not generally allow shading to be occluded on a per-pixel basis; however, ray tracing does. Mantra will perform occlusion culling to eliminate volumes that are hidden by a fully opaque surface, but if that surface is partly transparent or it is not solid across many tiles this optimization is likely to fail. The reason for this is that normally micropolygon or microvolume grids cover many pixels (often several tiles), so all those tiles would need to be fully occluded for the volume shading to be avoided.
Lighting
Area lights are very efficient to use with physically based rendering, specifically the environment light. For more information on lights see the Lighting help.
Diffuse secondary lighting
Secondary lighting can make a big difference to the appearance of a scene.
The following image was rendered only using direct lighting:
The following image was rendered using direct and indirect lighting:
There are two approaches to achieve indirect lighting using physically based rendering. You can either render long light paths using path tracing or cache indirect light to a photon map and then perform a final gather from the map.
Path tracing
To enable path tracing of longer paths using physically based rendering, you must increase the Diffuse Limit parameter on the PBR sub-tab in the parameter editor of the mantra output driver. Increasing the number of diffuse bounces will slow down the render and increase the amount of noise, so you might have to increase the number of samples to achieve a higher quality render.
View-dependent photon maps
Caching indirect lighting to a photon map requires the addition of an Indirect Light to the scene.
Workflow for Diffuse Photon Map Rendering
Managing a renderer that uses photon maps can be a little more complex than simply using PBR with extra diffuse bounces. Here’s a checklist to verify that the photon maps are being generated accurately and that your render is running as efficiently as possible. These steps assume that you are using the Physically Based Rendering Rendering Engine.
Create an Indirect Light using either the GI Light shelf tool or by using the tab menu to create an Indirect Light.
In the Render View, perform an initial render. Verify that the photon map generation progress is reported at the top of the IPR viewer before the image is rendered.
On the Indirect Light object, change the Light Type to Direct Global Photon Map. This setting can be used during interactive renders to verify that the photon map has been generated correctly and is a reasonable approximation for the diffuse lighting in the scene.
If the render appears to have large blocks of constant illumination, increase the Photon Count until the quality reaches an acceptable level.
Switch between Direct Global Photon Map and Indirect Global Photon Map to see the quality difference between rendering the photons directly and using them for indirect lighting. If enough photons exist in the scene, the overall light level for each render should be roughly the same.
If you notice some artifacts in corners, increase the Prefilter Samples or try increasing the Photon Distance Threshold. Increasing the number of samples may require you to go back and increase the Photon Count to sharpen the photon map result.
Parameters that will alter the global illumination performance and quality
| Photon Storage Count | This parameter displays the number of photons that are stored in a photon map. Larger numbers of photons will produce more accurate results. |
| View Photon Supersamples | This parameter displays the number of supersamples for view-dependent photon map generation. Larger numbers of supersamples will produce higher quality results. |
| Global Prefiltering | This checkbox determines if global photons should be prefiltered. Prefiltered maps average out photon values before the photon map is closed to allow faster photon look-up. |
| Global Count | This parameter displays the number of global photons to filter at a point. Larger numbers of filtered photons will produce blurry, smoother results. |
| Global Radius | This parameter displays the filter radius in world space. Photons will only be considered for filtering if they fall within the specified distance of the search point. |
Rendering caustics with PBR
Caustics are created when light (either from a light source, or a constant shaded object) passes through a specular material such as a refractive object or reflective surface, producing patterns of focused light on the surface behind it. You can render caustics using photon maps and the physically based rendering algorithm in mantra. When caustic paths are enabled, color bleeding will occur even from lights or surfaces that are hidden behind refractive/reflective objects.
This is an example of an image that does not have caustics. Notice that the light is not passing through the transparent object.
This is an example of what the scene looks like with caustics and light.
Rendering using caustics and light
If you use PBR, you don’t have to do anything else to see caustics. Use the Caustic Light tool on the Lights and Cameras shelf tab to add indirect light to the scene with the correct options. This tool adds an environment light using caustic photon maps, causing other lights in the scene to cast caustic reflections/refractions.
By default, when you place an indirect light using the Caustic Light tool, you have to turn off Prefilter Photon Map and increase the Filter Samples to 100 to get it to work correctly. Also, make sure you have a reflective/refractive material in the scene, such as the glass default shader.
Tip
Only apply the caustics to the objects that are generating the effect by putting these objects in the Photon Target parameter.
Deep rasters
Deep raster planes are exported by the pathtracer shader for PBR. The default PBR shader supports a number of export variables. Exports that are available as light exports can be exported either on a per-light basis or as a combination for all lights. To specify a per-light value, use the light name in the deep raster parameters. To specify a sum over all lights, leave the light name blank. The same variable name is used for both the light and combination export. However, you should name the deep raster planes differently.
VEX Variable Name | Type | Light Export | Description |
| vector | available | Direct lighting, diffuse component |
| vector | available | Direct lighting, specular component |
| vector | available | Direct lighting, reflection component |
| vector | available | Direct lighting, refraction component |
| vector | not available | Direct emission |
| vector | available | Indirect lighting, diffuse component |
| vector | available | Indirect lighting, specular component |
| vector | available | Indirect lighting, reflection component |
| vector | available | Indirect lighting, refraction component |
| vector | not available | Indirect emission |
| vector | available | All diffuse lighting |
| vector | available | All specular lighting |
| vector | not available | All emission lighting |
| vector | available | All direct lighting |
| vector | available | All indirect lighting |
| float | not available | Average pathtracing depth for a pixel |
| float | not available | Average diffuse pathtracing depth for a pixel |
| float | not available | Average specular pathtracing depth for a pixel |
Tips
Photon maps will only be generated for point lights and spot lights. If you are using point lights, make sure it is close enough to the scene to ensure that enough photons will hit your transparent geometry. If you are using spot lights, make sure it is illuminating as small an area of your scene as possible. You can do this by adjusting the Cone Angle and Cone Delta parameters on the Spot Light Options sub-tab of the Light tab.
If your render produces the error message: “Aborting photon generation from light...”, try moving your light closer to the scene or fixing the orienting toward your geometry. If the light is too far away from your scene it will not be able to efficiently generate photon maps.
Troubleshooting
White speckles
If you have white speckles in your image, you can try to fix it by limiting the number of color contributions a pixel will accept.
On the output driver Properties tab, add the mantra9.0/render/Color Limit property (see properties for information on how to add properties).
Decreasing this value is a bit of a hack: it can eliminate white speckles by clamping the amount of color contributed to each pixel, but it thereby darkens the image overall, and decreases the accuracy by truncating color contributions instead of distributing them equally.