Class: RectLightUtil
Defined in: src/util/RectLightUtil.ts:23
CPU mirror of RectLight_frag: analytic rectangular area light.
Constructors
Constructor
new RectLightUtil():
RectLightUtil
Returns
RectLightUtil
Methods
frame()
staticframe(light):object
Defined in: src/util/RectLightUtil.ts:32
Orthonormal frame of the panel: right, up, normal.
Parameters
light
Returns
object
right
right:
V3
up
up:
V3
normal
normal:
V3
corners()
staticcorners(light):V3[]
Defined in: src/util/RectLightUtil.ts:40
The four corners in world space.
Parameters
light
Returns
V3[]
formFactorVector()
staticformFactorVector(P,light):V3
Defined in: src/util/RectLightUtil.ts:53
Unclipped vector form factor of the panel seen from P (Lambert's polygon formula). Its length is the form factor toward the panel, its direction the mean incoming light direction.
Parameters
P
V3
light
Returns
V3
sphereFormFactor()
staticsphereFormFactor(cosTheta,sinSigmaSqr):number
Defined in: src/util/RectLightUtil.ts:70
Horizon-clipped form factor of a sphere with sin²σ = sinSigmaSqr at angle θ from the normal.
Parameters
cosTheta
number
sinSigmaSqr
number
Returns
number
falloff()
staticfalloff(distance,range):number
Defined in: src/util/RectLightUtil.ts:82
Distance window: 1 at the panel, 0 at range.
Parameters
distance
number
range
number
Returns
number
formFactor()
staticformFactor(P,N,light):number
Defined in: src/util/RectLightUtil.ts:92
Form factor (0..1) of the panel for a surface point P with normal N: irradiance = π · radiance · formFactor. Zero behind the emitting face.
Parameters
P
V3
N
V3
light
Returns
number
representativePoint()
staticrepresentativePoint(P,N,V,light):V3
Defined in: src/util/RectLightUtil.ts:102
Point of the panel that stands in for the whole light in the specular term.
Parameters
P
V3
N
V3
V
V3
light
Returns
V3
shade()
staticshade(P,N,V,albedo,metallic,roughness,F0,light):V3
Defined in: src/util/RectLightUtil.ts:121
Outgoing radiance toward V from a surface lit by the panel. roughness is the shader-side value (fragData.Roughness).
Parameters
P
V3
N
V3
V
V3
albedo
V3
metallic
number
roughness
number
F0
V3
light
Returns
V3

