Define a displacement shader with a program that moves a point on a surface before the surface is rendered.
Displacement shading can be used to move the position of the surface before the surface gets rendered. This lets you add fine detail to a surface, but is not intended for modeling.
After moving a surface, you must typically re-compute the normals of the surface. For surfaces which have interpolated normals (smooth shaded polygons), you can use the computenormal(vector P, N, Ng) function to approximate the “smooth” displaced normal.
Z component of the point being shaded.
The time at which the shading occurs, as a number from 0 (shutter open) to 1 (shutter close).
Change in position with respect to the parametric t.
Parametric t (sometimes called v) coordinate of the surface being shaded.
Floating point step size for volume rendering.
Shading normal for the surface.
Position of the point on the surface being shaded. In light or shadow shaders, the P variable contains the point on the light source.
Geometric normal for the surface. This normal represents the “true” normal of the surface being shaded. For example, with Phong shading, the N variable represents the interpolated normal, while the Ng variable represents the true polygon normal.
Parametric s (sometimes called u) coordinate of the surface being shaded.
Change in position with respect to the parametric s.