Renderer · function
reflectionCone
The cone half-angle a roughness reflects through.
Explained in Hello world.
function reflectionCone(roughness: number): numberimport { reflectionCone } from '@driftengine/core';Parameters
| Parameter | Type | Description |
|---|---|---|
roughness | number |
In depth
atan(roughness^2), which is the GGX lobe's own width rather than a curve chosen to look
right. The distribution's half-angle at half its peak is close to atan(alpha) and alpha is
roughness^2 in the parameterisation this engine uses everywhere else — roughnessForLevel in
prefilterEnvMap.ts maps a mip chain by the same square, so a surface that samples level three
of the prefiltered cube and a surface that cone-traces the world field agree about how blurred
they are. Two curves here would be two blurs that diverge with distance.
Zero is exactly zero, so a mirror traces a pencil ray and no epsilon creeps into the one case a
viewer inspects most closely. One is atan(1), a quarter turn's half — wide, and still short of
the hemisphere a fully diffuse surface gathers over, which is traceIndirect's job and not this.