Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This figure shows a small grid of surface points before and after displacement:  TO DO: scale images and put them side by side !!

View file
nameoriginalgrid.pdf
height250

View file
namedisplacedgrid.pdf
height250


Image AddedImage Added


Left: original surface points and normals, along with displacement amounts.  Right: displaced surface points.  (Note that some displacement amounts are negative.)

The surface positions and normals are in object space, which is convenient since it means that the displacements scale and rotate along with the object.  In the rare cases where displacements in world space are preferred, the amplitude simply needs to be scaled by the length of the normal transformed to world space.  (If the master object is instantiated to more than one instanced object, then the world transform of the first instance is used.)

Note that an object is only displaceed if three conditions are fulfilled:  1) the object needs to have a displacement shader attached to it, 2) the object needs to have an Attribute "displacementbound" greater than 0, and 3) the object's Attribute "trace" "displacements" needs to be 1 (which it is by default).

After the displacement has been done, any smooth analytical normals that the original surface may have had (for example a smooth subdivision surface or NURBS patch) are no longer valid – they do not correspond to the displaced surface.  However, each micropolygon has a geometric normal Ngn.  In addition, for some surface types, a smooth shading normal will be automatically computed for each ray hit – this is done by considering the orientation of not only the micropolygon that the ray hit, but also adjacent micropolygons.  For other surface types – most prominently displaced polygon meshes and displaced pretessellated subdivision surfaces – the shading normal is the same as the geometric normal, i.e. facetted.  (We plan to provide smooth shading normals also on these surface types in a future release.)

...

This bound means that any ray that is farther than 0.5 units away from the undisplaced surface can ignore that surface.  Only when a ray hits this "padded" bounding box (the bounding box of the undisplaced surface points, padded by 0.5 in x, y, and z) do we need to run the displacement shader.  Once the displacement shader has run and all the positions are known, their bounding box is computed and the BVH node bounding box is updated (tightened).  Selecting an appropriate displacement bound is important: if it is too large, the time to first pixel will be slow; if it is too small, the image will have holes (see the figure below).  In most cases, the displacement bound is the same as the magnitude parameter of the displacement.  To help select an appropriate displacement bound in harder cases, RenderMan will give a warning (after rendering is completed) if the specified displacement bound was too small or more than ten times too large.

Note that an object is only displaced if three conditions are fulfilled:  1) the object has a displacement shader attached to it, 2) the object has an Attribute "displacementbound" greater than 0.0, and 3) the object's Attribute "trace" "displacements" is 1 (which it is by default).

Example

Here is an example of a fragment of a RIB file with a sphere being turned into a five-pointed star:

...