domeNormal

The surface normals of a flat disc treated as a puffy dome, ready to light with shine.

domeNormal(opts: {
    delta: Expr
    dist: Expr
    radius: Expr | number
    bulge?: {tilt?: number; drop?: number}
}): Expr

Import light from shaders/std and use light.domeNormal.

delta is the offset from the disc center, dist its length and radius the disc size, all in the same unit. bulge.tilt (default 0.2) sets how far the normals lean outward at the rim and bulge.drop (default 0.1) how much the dome flattens toward its edge.

Parameters

NameTypeNotes
opts`{
delta: Expr
dist: Expr
radius: Expr \| number
bulge?: {tilt?: number; drop?: number}

}` | |

Example

const highlight = shine({normal: domeNormal({delta, dist, radius}), light: vec3(0.3, -0.5, 0.8), gloss: 32})

See also

  • shine — A specular highlight on any surface that gives you a normal.

Used by

Blob