7.11 Dicing Cameras
As we already know, 3Delight renders geometry by tessellating it into micro-polygons. This way of doing things makes running displacement shaders straightforward and efficient. One potential problem might arise though: when rendering sequences with a moving camera, the renderer might tessellate the geometry slightly differently from frame to frame, leading to displacement shaders to react differently between frames and this in turn may lead to pops in static geometry. This usually happens in displacement shaders that have a high perturbation frequency. Although this problem can be solved using lower shading rates and proper anti-aliasing it is often easier to use a dicing camera.
A dicing camera is a camera that is declared along with the main camera and is usually static in the animation sequence, so that objects are always tessellated the same way from frame to frame. One can declare such a camera using the RiCamera command:
Display "example.tif" "tiff" "rgb" Format 640 480 1 Projection "perspective" "fov" 60 Translate 0 0 5 TransformBegin Translate 0 0 100 Camera "faraway" TransformEnd WorldBegin Translate 0 -1.5 0 Rotate -90 1 0 0 Attribute "dice" "referencecamera" "faraway" Geometry "teapot" WorldEnd |
In this example, a teapot is diced using a camera named "faraway" that has been placed very far (see dice-referencecamera). So rendering the image will produce a teapot with very rough tessellation. A few notes:
- It is possible to declare multiple cameras and use them on different objects, if desired.
- A camera will take into account the entire graphical state when declared: screen window, resolution, field of view, etc... This means that one can control the shading rate of a camera by changing the resolution prior to its declaration (lower resolution means higher shading rate).
IMPORTANTBefore integrating dicing cameras into your pipeline, make sure the problem has been correctly identified. Dicing cameras will make your pipeline slightly more complicated and many problematic displacement shaders can be healed by proper programming.
3Delight 8.5. Copyright 2000-2009 The 3Delight Team. All Rights Reserved.