marchedNormal

The surface normal of a 3D shape, from the marched depth.

marchedNormal(field: SurfaceField, sharpness: number = 5, hint: string = 'nGeo'): Expr

Import materials from shaders/std and use materials.marchedNormal.

Only meaningful when frame.volumetric is true. geometricNormal chooses between this and the flat-shape normal for you. sharpness clamps the slope (default 5; 4 is calmer, 6 crisper).

Parameters

NameTypeNotes
fieldSurfaceField
sharpnessnumberOptional. Default 5.
hintstringOptional. Default 'nGeo'.

Example

const n = frame.volumetric ? marchedNormal(field, 4) : flatNormal

See also

  • geometricNormal — The surface normal of the shape, whichever kind of shape is active.

Used by

Chrome, Crystal, Plastic, Water