Overview
Starting with 23.3, Current RenderMan can bake integrator results to images or points clouds.
Potential applications include transferring pre-computed global illumination for real-time realtime playback or optimising optimizing render times for large static assets.
Additional details are provided in the baking app note.
Limitations
The current implementation comes with a number of important limitations:
- Baking is non-incremental.
- This limitation excludes integrators that can not be setup to render in a single increment, like PxrVCM.
- PxrPathTracer, PxrDirectLighting, PxrOcclusion and PxrVisualizer are compatible.
- Baking is incompatible with curves.
- Baking cannot be used with sample filters or display filters
- Each baking display can use at most one RGBA display channel.
- Use multiple display drivers to output multiple signals.
- All images are baked at the same resolution.
- No breakpointing / stop-and-resume during baking
- There is no separate irradiance output
As a workaround, we suggest baking illumination and albedo: dividing the illumination by the albedo gives the irradiance.
...
Image Grid Gallery | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Two views of a single point cloud with direct illumination on the box and the two teapots (baked with the PxrDirectLighting integrator).
Image Grid Gallery | ||||||
---|---|---|---|---|---|---|
|
Two This example shows two point clouds with global illumination (baked using the PxrPathTracer integrator): one for the box and one for a teapot.
Box GI point cloud | Teapot GI point cloud | Render using GI point clouds |
Finally, we can render an image using these global illumination point clouds as textures.
The 3D point clouds can be read in an OSL shader using the texture3d() function (For a more cache-friendly 3D texture format, the point clouds can be converted into brick maps using the `brickmake' utility program.)
Multiple outputs, arbitrary output variables, LPEs
Similar to raytrace rendering, \textit{light path expressions} (LPEs) may be used to isolate different components of global illumination while baking. The data that can be baked is very general: if an integrator can splat it, then the illumination baker can write it to a display driver.
For example, the view-independent components of global illumination can be precomputed. As a simple example, here we declare direct diffuse and indirect diffuse outputs:
Code Block |
---|
DisplayChannel "color directDiffuse" "string source" ["color lpe:C<RD>[LO]"]
DisplayChannel "color indirectDiffuse" "string source" ["color lpe:C<RD>.+[LO]"]
Display "<identifier:object>DirectDiffuse.tif" "tiff" "directDiffuse"
Display "+<identifier:object>IndirectDiffuse.tif" "tiff" "indirectDiffuse" |
Similarly, the albedo user lobe may be rendered with an albedo LPE:
Code Block |
---|
Option "lpe" "string user2" ["Albedo,DiffuseAlbedo,SubsurfaceAlbedo,HairAlbedo"]
DisplayChannel "color albedo" "string source" ["color lpe:overwrite;C(U2L)|O"]
Display "+<identifier:object>Albedo.tif" "tiff" "albedo"
|
The images below shows albedo, direct diffuse, and indirect diffuse for the Cornell box with two spheres.
Image Grid Gallery maxNumber 6 sources REN23:Ym94MV9scGVzX2FsYmVkby5wbmc=:QmFraW5nIElsbHVtaW5hdGlvbg==,REN23:Ym94Ml9scGVzX2FsYmVkby5wbmc=:QmFraW5nIElsbHVtaW5hdGlvbg==,REN23:Ym94M19scGVzX2FsYmVkby5wbmc=:QmFraW5nIElsbHVtaW5hdGlvbg==,REN23:Ym94NF9scGVzX2FsYmVkby5wbmc=:QmFraW5nIElsbHVtaW5hdGlvbg==,REN23:Ym94NV9scGVzX2FsYmVkby5wbmc=:QmFraW5nIElsbHVtaW5hdGlvbg==,REN23:c3BoZXJlMl9scGVzX2FsYmVkby5wbmc=:QmFraW5nIElsbHVtaW5hdGlvbg== itemSize 100 animate false
Image Grid Gallery maxNumber 6 sources REN23:Ym94MV9scGVzX2RpcmVjdC5wbmc=:QmFraW5nIElsbHVtaW5hdGlvbg==,REN23:Ym94Ml9scGVzX2RpcmVjdC5wbmc=:QmFraW5nIElsbHVtaW5hdGlvbg==,REN23:Ym94M19scGVzX2RpcmVjdC5wbmc=:QmFraW5nIElsbHVtaW5hdGlvbg==,REN23:Ym94NF9scGVzX2RpcmVjdC5wbmc=:QmFraW5nIElsbHVtaW5hdGlvbg==,REN23:Ym94NV9scGVzX2RpcmVjdC5wbmc=:QmFraW5nIElsbHVtaW5hdGlvbg==,REN23:c3BoZXJlMl9scGVzX2RpcmVjdC5wbmc=:QmFraW5nIElsbHVtaW5hdGlvbg== itemSize 100 animate false
Image Grid Gallery maxNumber 6 sources REN23:Ym94MV9scGVzX2luZGlyZWN0LnBuZw==:QmFraW5nIElsbHVtaW5hdGlvbg==,REN23:Ym94Ml9scGVzX2luZGlyZWN0LnBuZw==:QmFraW5nIElsbHVtaW5hdGlvbg==,REN23:Ym94M19scGVzX2luZGlyZWN0LnBuZw==:QmFraW5nIElsbHVtaW5hdGlvbg==,REN23:Ym94NF9scGVzX2luZGlyZWN0LnBuZw==:QmFraW5nIElsbHVtaW5hdGlvbg==,REN23:Ym94NV9scGVzX2luZGlyZWN0LnBuZw==:QmFraW5nIElsbHVtaW5hdGlvbg==,REN23:c3BoZXJlMl9scGVzX2luZGlyZWN0LnBuZw==:QmFraW5nIElsbHVtaW5hdGlvbg== itemSize 100 animate false