Skip to content

Commit

Permalink
Update CSMShadowNode.js
Browse files Browse the repository at this point in the history
Fix main frustum with WebGL backend.
  • Loading branch information
Mugen87 authored Oct 15, 2024
1 parent 6c022a2 commit b441f99
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions examples/jsm/csm/CSMShadowNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
MathUtils,
Matrix4,
Box3,
Object3D
Object3D,
WebGLCoordinateSystem
} from 'three';

import { CSMFrustum } from './CSMFrustum.js';
Expand Down Expand Up @@ -52,7 +53,7 @@ class CSMShadowNode extends Node {
this.breaks = [];

this._cascades = [];
this.mainFrustum = new CSMFrustum();
this.mainFrustum = null;
this.frustums = [];
this.updateBeforeType = NodeUpdateType.FRAME;

Expand All @@ -62,10 +63,13 @@ class CSMShadowNode extends Node {

}

init( { camera } ) {
init( { camera, renderer } ) {

this.camera = camera;

const data = { webGL: renderer.coordinateSystem === WebGLCoordinateSystem };
this.mainFrustum = new CSMFrustum( data );

const light = this.light;
const parent = light.parent;

Expand Down

0 comments on commit b441f99

Please sign in to comment.