File: LensflareNode.md | Updated: 11/15/2025
Post processing node for adding a bloom-based lens flare effect. This effect requires that you extract the bloom of the scene via a bloom pass first.
References:
LensflareNode is an addon, and must be imported explicitly, see Installation#Addons.
import { lensflare } from 'three/addons/tsl/display/LensflareNode.js';
Constructs a new lens flare node.
textureNode | The texture node that represents the scene's bloom.
---|---
params | The parameter object for configuring the effect. | ghostTint | Defines the tint of the flare/ghosts. Default is vec3(1, 1, 1).
---|---
threshold | Controls the size and strength of the effect. A higher threshold results in smaller flares. Default is float(0.5).
ghostSamples | Represents the number of flares/ghosts per bright spot which pivot around the center. Default is float(4).
ghostSpacing | Defines the spacing of the flares/ghosts. Default is float(0.25).
ghostAttenuationFactor | Defines the attenuation factor of flares/ghosts. Default is float(25).
downSampleRatio | Defines how downsampling since the effect is usually not rendered at full resolution. Default is 4.
Defines how downsampling since the effect is usually not rendered at full resolution.
Defines the attenuation factor of flares/ghosts.
Represents the number of flares/ghosts per bright spot which pivot around the center.
Defines the spacing of the flares/ghosts.
Defines the tint of the flare/ghosts.
The texture node that represents the scene's bloom.
Controls the size and strength of the effect. A higher threshold results in smaller flares.
The updateBeforeType is set to NodeUpdateType.FRAME since the node renders its effect once per frame in updateBefore().
Default is 'frame'.
Overrides: TempNode#updateBeforeType
Frees internal resources. This method should be called when the effect is no longer required.
Overrides: TempNode#dispose
Returns the result of the effect as a texture node.
Returns: A texture node that represents the result of the effect.
Sets the size of the effect.
width | The width of the effect.
---|---
height | The height of the effect.
This method is used to setup the effect's TSL code.
builder | The current node builder.
---|---
Overrides: TempNode#setup
This method is used to render the effect once per frame.
frame | The current node frame.
---|---
Overrides: TempNode#updateBefore