Rendering Physically based rendering
See also: How to use caustics, How to work with glass
This is a new feature in Houdini 9. To learn about more new features, see what’s new in Houdini 9.
Overview
Physically based rendering is a new set of rendering engines for mantra that support accurate physical simulations of light and shading. It is useful for rendering many types of scenes, for example:
-
Scenes that requires soft shadows from an environment map or area lights.
-
Scenes with a lot of indirect lighting (such as closed rooms with reflective walls).
-
Scenes with glossy reflections and refractions.
-
Scenes with caustics.
Physically based rendering is not useful to use when your scene contains volumetric lighting effects or has hard shadows from point or spot lights.
Default renders using physically based rendering are very similar to regular micropolygon renders. However, physically based rendering also automatically enables: raytraced shadows from all lights, raytraced reflections and refractions, glossy reflections and refractions, and reflected light sources.
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 Pixel Samples to control motion blur and antialiasing, and Min Ray Samples to improve the global illumination quality. 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.
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 two output drivers, one to render the photon map and one to use the photon map for final gathering in the render.
| To... | Do this |
|---|---|
|
Set up a mantra render node for photon map generation |
|
|
Set up a mantra render node to perform a final gather from the photon map |
|
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 formed when light refracts through a transparent surface, producing patters of focused light on the surface behind it. You can render caustics using photon maps and the physically based rendering algorithm in mantra.
This is an example of an image that does not have caustics. Notice that the light is not passing through the transparent object.
Rendering using caustics and light
Adding caustics requires two output drivers. One will generate the photon map and the other will render the final image using the generated photon map.
-
Set up a mantra render node to use as the PBR rendering engine and name it “caustics_and_light”.
-
Create another mantra render node and name it “photon_generate”.
-
Change the Rendering Engine on the Render sub-tab of the Properties tab to Photon Map Generation on the “photon_generate” render node.
-
Set the file name you want to save your photon map to in the Caustic Photon File field on the PBR sub-tab of the Properties tab on the “photon_generate” render node.
-
Clear the name of the Global Photon File field on the “photon_generate” render node.
If a global photon map is used, then the number of photons generated will be split between the caustic and the global photon map, resulting in poorer quality caustics.
-
Render the photon map (“photon_generate” render node).
You can adjust the quality and performance of the map generation by changing the Photon Storage Count parameter, which controls the number of photons that will be stored to the caustic photon map.
-
On the PBR tab of the “caustics_and_light” render node, set the Caustic Cache File to Photon Map and set the Caustic Photon File to the same name you used on the “photon_generate” render node.
-
Render “caustics_and_light” render node.
You will see an image with caustics and light.
Rendering using caustics only
Rendering caustics with the main render as described above can be very slow, especially when the number of pixel samples used in the render is large. Instead, you may want to render caustics with less pixel samples while still retaining a high image quality. To render caustics without light, do the following:
-
Render a photon map using the “photon_generate” node described above.
-
Copy the “caustics_and_light” render node and create a new output driver.
-
Rename the new output driver “caustics_only”.
-
On the Objects tab of the “caustics_only” render node, clear the Candidate Lights field.
You can do this by deleting the *. Clearing the candidate lights will produce a render without lighting. The only light in the scene will come from the caustic photon map.
-
On the Sampling tab of the “caustics_only” render node, set the pixel samples to a lower value to improve performance while still maintaining an acceptable noise level.
-
Render the “caustics_only” render node.
You will see an image with caustics, but with no candidate lights.
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 are 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.