---
title: "Displacement in Blender"
canonical: "https://rmanwiki-26.pixar.com/space/RFB26/20086874/Displacement%20in%20Blender"
format: markdown
---
To render displacement on your geometry in RenderMan for Blender, use the [PxrDisplace](https://renderman.atlassian.net/wiki/spaces/REN26/pages/19661545) node.

## Adding PxrDisplace


To add PxrDisplace, make sure you've already added a RenderMan material to your geometry. In the material properties > Macro (inline-media-image)

 , under the Displacement panel, select PxrDisplace from dropdown list next to "Displacement".


![displacement_pxrdisplace.png](media://47cdc59c-fe01-49ce-b21b-a7d51561ac76)


The main parameters you will probably be working with are:

- **Gain**: <span style="color: #000000">Gain for the displacement. If it is zero, there will be no displacement. </span>
- **Scalar Displacement**: <span style="color: #000000">Scalar displacement input. This is a float displacement.</span>
- **Vector Displacement**: <span style="color: #000000">Vector displacement input. Vector displacement data is a three channel data file,  XYZ.</span>

There are also some utility patterns for displacement:

- For transform related functions use the [PxrDispTransform](https://renderman.atlassian.net/wiki/spaces/REN26/pages/19661615) pattern.
- For displacement layering, use either [PxrDispScalarLayer](https://renderman.atlassian.net/wiki/spaces/REN26/pages/19661613) and [PxrDispVectorLayer](https://renderman.atlassian.net/wiki/spaces/REN26/pages/19662123) 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 properties > Macro (inline-media-image)

 on the mesh. 


![prevent_polygon_cracks.png](media://35328d7d-134f-4665-a749-d74804f04eeb)


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.