To render displacement on your geometry in RenderMan for Blender, use the PxrDisplace node.
To add PxrDisplace, make sure you've already added a RenderMan material to your geometry. In the material properties, under the Displacement panel, select PxrDisplace from dropdown list next to "Displacement".
The main parameters you will probably be working with are:
- Gain: Gain for the displacement. If it is zero, there will be no displacement.
- Scalar Displacement: Scalar displacement input. This is a float displacement.
- Vector Displacement: Vector displacement input. Vector displacement data is a three channel data file, XYZ.
There are also some utility patterns for displacement:
- For transform related functions use the PxrDispTransform pattern.
- For displacement layering, use either PxrDispScalarLayer and PxrDispVectorLayer pattern.
Avoiding cracks on polygonal meshes
When displacing a mesh with hard normals, faces can separate and create cracks. Displacement moves vertices in the direction of its normal but adjacent vertices on different sides of a hard edge have different normals and will move is different directions, creating gaps or cracks.
RenderMan has a "
polygon:smoothdisplacement" attribute that will create a fully smoothed copy of the normals and use it instead of the original normals.
In RenderMan for Blender, this attribute is enabled by the "Prevent polygon cracking" check box in the object data propertieson the mesh.
Here's a before and after with displacement attached to a cube mesh.
"Prevent polygon cracking" should only be enabled when necessary as it uses a bit more memory. The amount used is proportional to the number of vertices in the mesh.