Renderer · function
ggxMaxLevelFor
The coarsest level the GGX chain reaches, which is one below the irradiance level.
Explained in Hello world.
function ggxMaxLevelFor(edge: number): numberimport { ggxMaxLevelFor } from '@driftengine/core';Parameters
| Parameter | Type | Description |
|---|---|---|
edge | number |
In depth
This is uEnvironmentMaxLod, and it is what roughnessForLevel maps roughness 1 onto. For the
default edge it is 4, so the roughest level is 16 texels across.
That is better at high roughness than the cube it replaces, not worse. A 128 cube's chain ends at one texel a face, which the lit pass's own comment complains about — "one texel a face and therefore one colour for every direction". What is given up is roughness granularity, five stops against eight, and the level blend interpolates between them exactly as the cube's mip filter did.