RSL
|
Displacement Shader Algorithm
Displacement shaders alter the smoothness of a surface, however, unlike bump mapping which mimics the appearance of bumpiness by reorientating surface normals, displacement shading genuinly effects the geometry of a surface. In the case of Pixars prman renderer, each object in a 3D scene is sub-divided into a fine mesh of micro-polygons after which, if a displacement shader has been assigned to an object, they are "pushed" or "pulled" in a direction that is parallel to the original surface normal of the micro-polygon. After displacing the micro-polygon the orientation of the local surface normal(
N ) is recalculated.Figure 1
The following algorithm lists the four basic steps that a displacement shader generally follows in order to set the position (
P ) and normal (N ) of the micro-polygon being shaded.
To make a meaningful decision about the distance, if any, a micro-polygon should be displaced, a shader will make reference to the micro-polygon's,
plus other less obvious attributes of a micro-polygon. Such information is either directly or indirectly available in data the renderer makes available to a shader through the use of global variables.
|
Displacement Shading & Global Variables
The following table lists the global variables accessible to a displacement shader. [List of global variables available to surface shaders].
|
http://www.fundza.com/rman_shaders/displacement/ds_displacement1.html
http://www.fundza.com/rman_shaders/displacement/index.html
No comments:
Post a Comment