gatherIrradiance
The light arriving at a pixel from a glowing shape edge, with the shape's body blocking it.
gatherIrradiance(spec: GatherSpec): Expr
Import radiance from shaders/std and use radiance.gatherIrradiance.
Looks out from the pixel in cones directions, finds where each touches the shape, and averages the emission there. Edges facing away or hidden behind the body contribute nothing. Returns one number: the brightness at this pixel. It runs per pixel per frame, so prefer irradianceField unless the light must be live.
Parameters
| Name | Type | Notes |
|---|---|---|
spec | GatherSpec |
Example
const light = gatherIrradiance({origin: frame.sdfUV!, field: far.at, cones: 16, steps: 24, reach: 3, start: far.sdf, surfaceEps: px, jitter: hash, emission: ({normal}) => math.max(math.dot(normal, lightDir), 0), deps: [lightDir]})
Tip. Any value computed outside
emissionand read inside it must be listed indeps.
See also
irradianceField— The light spilling from a shape's edges, gathered once into a texture and read per pixel.shadowVisibility— How much of a light reaches a point, 1 when nothing is in the way and 0 when the shape blocks it.