File: LensflareMesh.md | Updated: 11/15/2025
Creates a simulated lens flare that tracks a light.
Note that this class can only be used with WebGPURenderer. When using WebGLRenderer, use Lensflare.
const light = new THREE.PointLight( 0xffffff, 1.5, 2000 );
const lensflare = new LensflareMesh();
lensflare.addElement( new LensflareElement( textureFlare0, 512, 0 ) );
lensflare.addElement( new LensflareElement( textureFlare1, 512, 0 ) );
lensflare.addElement( new LensflareElement( textureFlare2, 60, 0.6 ) );
light.add( lensflare );
LensflareMesh is an addon, and must be imported explicitly, see Installation#Addons.
import { LensflareMesh } from 'three/addons/objects/LensflareMesh.js';
Constructs a new lensflare mesh.
Overwritten to disable view-frustum culling by default.
Default is false.
Overrides: Mesh#frustumCulled
This flag can be used for type testing.
Default is true.
Overwritten to make sure lensflares a rendered last.
Default is Infinity.
Overrides: Mesh#renderOrder
Adds the given lensflare element to this instance.
element | The element to add.
---|---
Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.