Capítulo 402 de 859
An implementation of Cascade Shadow Maps (CSM).
This module can only be used with WebGPURenderer. When using WebGLRenderer, use CSM instead.
[0,1] the defines how the mainCSM frustum should be split up.mode='custom'.import { CSMShadowNode } from 'three/addons/csm/CSMShadowNode.js';
Constructor
| Signature |
|---|
new CSMShadowNode( light : DirectionalLight, data : CSMShadowNode~Data ) |
Properties
| Property | Description |
|---|---|
.breaks : Array.<number> | An array of numbers in the range [0,1] the defines how the mainCSM frustum should be split up. |
.camera : Camera | The scene's camera. |
.cascades : number | The number of cascades. |
.customSplitsCallback : function | Custom split callback when using mode='custom'. |
.fade : boolean | Whether to fade between cascades or not. |
.frustums : Array.<CSMFrustum> | An array of frustums representing the cascades. |
.lightMargin : number | The light margin. |
.lights : Array.<DirectionalLight> | An array of directional lights which cast the shadows for the different cascades. There is one directional light for each cascade. |
.mainFrustum : CSMFrustum | The main frustum. |
.maxFar : number | The maximum far value. |
| `.mode : 'practical' | 'uniform' |
Methods
| Method | Description |
|---|---|
.dispose() | Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app. |
.updateFrustums() | Applications must call this method every time they change camera or CSM settings. |