Inheritance: EventDispatcher → Object3D → Mesh →
A Shadow Mesh that follows a shadow-casting mesh in the scene, but is confined to a single plane. This technique can be used as a very performant alternative to classic shadow mapping. However, it has serious limitations like:
const cubeShadow = new ShadowMesh( cube );
scene.add( cubeShadow );
ShadowMesh is an addon, and must be imported explicitly, see Installation#Addons.
import { ShadowMesh } from 'three/addons/objects/ShadowMesh.js';
Constructs a new shadow mesh.
mesh
The shadow-casting reference 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 disable automatic matrix update. The local matrix is computed manually in ShadowMesh#update.
Default is false.
Overrides: Mesh#matrixAutoUpdate
Represent the world matrix of the reference mesh.
Updates the shadow mesh so it follows its shadow-casting reference mesh.
plane
The plane onto the shadow mesh is projected.
lightPosition4D
The light position.