diff --git a/examples/jsm/csm/CSMShadowNode.js b/examples/jsm/csm/CSMShadowNode.js index 84984a8f708029..96f3884baaf76c 100644 --- a/examples/jsm/csm/CSMShadowNode.js +++ b/examples/jsm/csm/CSMShadowNode.js @@ -491,6 +491,16 @@ class CSMShadowNode extends ShadowBaseNode { } + build( builder ) { + + // register before the shadow nodes so `updateBefore()` runs first + + builder.addSequentialNode( this ); + + return super.build( builder ); + + } + setup( builder ) { if ( this.camera === null ) this._init( builder ); @@ -562,6 +572,9 @@ class CSMShadowNode extends ShadowBaseNode { lwLight.target.position.copy( _center ); lwLight.target.position.add( _lightDirection ); + lwLight.updateMatrixWorld(); + lwLight.target.updateMatrixWorld(); + } } diff --git a/examples/screenshots/webgpu_shadowmap_csm.jpg b/examples/screenshots/webgpu_shadowmap_csm.jpg index 09113409da95ae..e0da0971b90bfd 100644 Binary files a/examples/screenshots/webgpu_shadowmap_csm.jpg and b/examples/screenshots/webgpu_shadowmap_csm.jpg differ