The lookup as a self-contained module snippet with its bindings in @group(group): binding+0 the
atlas, +1 a filtering sampler, +2 the table (var<storage, read> array<vec4f>). Defines:
fn probeLookup(P, N, R, roughness, envRotation, frameIrr, withEnv) -> vec4f (the general form)
fn probeRadiance(P: vec3f, R: vec3f, roughness: f32) -> vec4f
(probe radiance normalized by coverage, coverage); no environment
fn probeRadianceWithEnvironment(P: vec3f, R: vec3f, roughness: f32) -> vec3f
probes, then the environment slot for the uncovered rest
fn probeRadianceN(P, N, R, roughness) -> vec4f and probeRadianceWithEnvironmentN(...) -> vec3f
the same with the shading normal (dominant direction, re-fit)
fn probeSpecularOcclusion(NdotV: f32, ao: f32, roughness: f32) -> f32
fn probeProxyShare(P: vec3f, dir: vec3f, near: f32, far: f32) -> f32
see probeProxyShareFunctionWgsl
roughness is perceptual. Without N (the first two), N = R: no dominant-direction bend, and the
re-fit evaluates irradiance about R.
Several sets in one module (any layouts, D805): pass an array, each with its own suffix and
group / binding range. The includes are emitted once for all of them:
The lookup as a self-contained module snippet with its bindings in @group(group): binding+0 the atlas, +1 a filtering sampler, +2 the table (
var<storage, read> array<vec4f>). Defines:fn probeLookup(P, N, R, roughness, envRotation, frameIrr, withEnv) -> vec4f (the general form) fn probeRadiance(P: vec3f, R: vec3f, roughness: f32) -> vec4f (probe radiance normalized by coverage, coverage); no environment fn probeRadianceWithEnvironment(P: vec3f, R: vec3f, roughness: f32) -> vec3f probes, then the environment slot for the uncovered rest fn probeRadianceN(P, N, R, roughness) -> vec4f and probeRadianceWithEnvironmentN(...) -> vec3f the same with the shading normal (dominant direction, re-fit) fn probeSpecularOcclusion(NdotV: f32, ao: f32, roughness: f32) -> f32 fn probeProxyShare(P: vec3f, dir: vec3f, near: f32, far: f32) -> f32 see probeProxyShareFunctionWgsl
roughnessis perceptual. Without N (the first two), N = R: no dominant-direction bend, and the re-fit evaluates irradiance about R.Several sets in one module (any layouts, D805): pass an array, each with its own
suffixand group / binding range. The includes are emitted once for all of them:probeLookupWgsl([a.lookupOptions({ group: 1 }), b.lookupOptions({ group: 2, suffix: 'B' })]) // probeRadiance(P, R, r) samples a, probeRadianceB(P, R, r) samples b