dicing camera
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.
主要用来处理高重复的displacement抖动的问题,或者其他类似抖动的问题, 使用单独的camera做dicing 保证每次计算的mirco-polygons都是一致的
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:
dicing camera 一般是相对需要dicing物体静止的相机 使用RiCamera 语句来调用:
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
1 Display "example.tif" "tiff" "rgb"
2
3
4
5 Format 640 480 1
6
7 Projection "perspective" "fov" 60
8
9 Translate 0 0 5
10
11
12
13 TransformBegin
14
15 Translate 0 0 100
16
17 Camera "faraway"
18
19 TransformEnd
20
21
22
23 WorldBegin
24
25 Translate 0 -1.5 0
26
27 Rotate -90 1 0 0
28
29 Attribute "dice" "referencecamera" "faraway"
30
31 Geometry "teapot"
32
33
Listing 7.10: Declaring and using a dicing camera.
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:
这个例子中,teapot被离他很远的一个camera "faraway"dicing所以,渲染出来的图片中teapot很粗糙
It is possible to declare multiple cameras and use them on different objects, if desired.
可以创建多个camera对多个物体进行dicing
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). 上面这一段不是很清楚
IMPORTANT
Before 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.
需要注意的是dicing camera 会使流程变得复杂,而很多displacement的问题都可以通过修改和优化shader来解决,所以在使用dicing camera之前先考虑一下是否有更好的办法。
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
1 Display "example.tif" "tiff" "rgb"
2
3
4
5 Format 640 480 1
6
7 Projection "perspective" "fov" 60
8
9 Translate 0 0 5
10
11
12
13 TransformBegin
14
15 Translate 0 0 100
16
17 Camera "faraway"
18
19 TransformEnd
20
21
22
23 WorldBegin
24
25 Translate 0 -1.5 0
26
27 Rotate -90 1 0 0
28
29 Attribute "dice" "referencecamera" "faraway"
30
31 Geometry "teapot"
32
33