opticalThickness

How much material the view passes through at this pixel: 0 at the edge, up to about 1.2 deep inside.

opticalThickness(field: SurfaceField, frame: SurfaceFrame): Expr

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

Multiply by a density prop and feed beerLambert for glass, ice and water.

Parameters

NameTypeNotes
fieldSurfaceField
frameSurfaceFrame

Example

const thickness = mul(opticalThickness(field, frame), u.density)

See also

  • beerLambert — How much light survives a thickness of tinted material, per channel.

Used by

Frost, Water