File: ShadowNode.md | Updated: 11/15/2025
Represents the default shadow implementation for lighting nodes.
Constructs a new shadow node.
light | The shadow casting light.
---|---
shadow | An optional light shadow. Default is null.
This index can be used when overriding setupRenderTarget with a RenderTarget Array to specify the depth layer.
Default is true.
This flag can be used for type testing.
Default is true.
The light shadow which defines the properties light's shadow.
Default is null.
A reference to the shadow map which is a render target.
Default is null.
Only relevant for VSM shadows. Node material which is used to render the second VSM pass.
Default is null.
Only relevant for VSM shadows. Node material which is used to render the first VSM pass.
Default is null.
Only relevant for VSM shadows. Render target for the second VSM render pass.
Default is null.
Only relevant for VSM shadows. Render target for the first VSM render pass.
Default is null.
Frees the internal resources of this shadow node.
Overrides: ShadowBaseNode#dispose
Returns the shadow filtering function for the given shadow type.
type | The shadow type.
---|---
Returns: The filtering function.
Renders the shadow. The logic of this function could be included into ShadowNode#updateShadow however more specialized shadow nodes might require a custom shadow map rendering. By having a dedicated method, it's easier to overwrite the default behavior.
frame | A reference to the current node frame.
---|---
The implementation performs the setup of the output node. An output is only produces if shadow mapping is globally enabled in the renderer.
builder | A reference to the current node builder.
---|---
Overrides: ShadowBaseNode#setup
Returns: The output node.
Setups the shadow output node.
builder | A reference to the current node builder.
---|---
Returns: The shadow output node.
Setups the shadow coordinates.
builder | A reference to the current node builder.
---|---
shadowPosition | A node representing the shadow position.
Returns: The shadow coordinates.
Setups the shadow filtering.
builder | A reference to the current node builder.
---|---
inputs | A configuration object that defines the shadow filtering. | filterFn | This function defines the filtering type of the shadow map e.g. PCF.
---|---
depthTexture | A reference to the shadow map's texture data.
shadowCoord | Shadow coordinates which are used to sample from the shadow map.
shadow | The light shadow.
Returns: The result node of the shadow filtering.
The implementation performs the update of the shadow map if necessary.
frame | A reference to the current node frame.
---|---
Overrides: ShadowBaseNode#updateBefore
Updates the shadow.
frame | A reference to the current node frame.
---|---
For VSM additional render passes are required.
renderer | A reference to the current renderer.
---|---