Skip to main content

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​

NameType
cameraPerspectiveCamera
airlightLocalLightAirlight
optionsObject
options.skyDistance?number

Returns​

LocalLightAirlightEffect

Properties​

uniforms​

• Readonly uniforms: Object

Type declaration​

NameType
cameraPositionValueUniform<Vector3>
cameraWorldValueUniform<Matrix4>
farValueUniform<1000>
inverseProjectionValueUniform<Matrix4>
nearValueUniform<0.1>
skyDistanceValueUniform<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​

NameType
colorVec4Node
depthTextureNode
uvVec2Node

Returns​

Vec4Node


update​

▸ update(): void

Copies the scene camera the effect reconstructs rays from.

Returns​

void