Built-in functions – Miscellaneous functions
normalWS() vec3

Returns the shading normal for the current surface point in world space.

posOS() vec3

Returns the current surface point in object space coordinates.

minCosTheta() real

Returns the minimum of the cosines of the zenith angles of the incident and exitant vectors of a ray scattering off a surface.

maxCosTheta() real

Returns the maximum of the cosines of the zenith angles of the incident and exitant vectors of a ray scattering off a surface.

intrinsicCoords() vec2

Returns the intrinsic coordinates for the intersected triangle.

objectId() int

Returns a unique integer identifier for the currently hit object.

meanCurvature() real

Return the mean curvature at the current point.


Curvature shader controlling the material colour. Red = negative mean curvature, green/blue = positive mean curvature.