Class: LocalLightAirlightEffect
Lamp light in the air: along each view ray, the light the air scatters toward the eye from the few local lights the camera can see, integrated in closed form up to the surface the ray hits. A ray passing near a torch collects warmth that thickens toward the source; a ray that ends on a wall before reaching the light collects only the air in front of the wall. No ray march, one node in the frame's effect chain, and an early out when no member glows (daylight, no lights in view, strength 0).
It reads the uniform set a LocalLightAirlight maintains; the camera's matrices are copied on every update, since a screen pass draws with its own camera, not the scene's.
Constructors
constructor
• new LocalLightAirlightEffect(camera, airlight, options?): LocalLightAirlightEffect
Parameters
| Name | Type |
|---|---|
camera | PerspectiveCamera |
airlight | LocalLightAirlight |
options | Object |
options.skyDistance? | number |
Returns
Properties
uniforms
• Readonly uniforms: Object
Type declaration
| Name | Type |
|---|---|
cameraPosition | ValueUniform<Vector3> |
cameraWorld | ValueUniform<Matrix4> |
far | ValueUniform<1000> |
inverseProjection | ValueUniform<Matrix4> |
near | ValueUniform<0.1> |
skyDistance | ValueUniform<192> |
Methods
apply
▸ apply(color, depth, uv): Vec4Node
The frame's colour with the air light added. depth is the scene's
depth texture, read at uv (a target uv).
Parameters
| Name | Type |
|---|---|
color | Vec4Node |
depth | TextureNode |
uv | Vec2Node |
Returns
update
▸ update(): void
Copies the scene camera the effect reconstructs rays from.
Returns
void