Skip to content

Commit

Permalink
Update ShadowNode.js
Browse files Browse the repository at this point in the history
  • Loading branch information
sunag committed Nov 19, 2024
1 parent 02efd07 commit 2277aa0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nodes/lighting/ShadowNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ class ShadowNode extends Node {
// The normally available "cameraNear" and "cameraFar" nodes cannot be used here because they do not get
// updated to use the shadow camera. So, we have to declare our own "local" ones here.
// TODO: How do we get the cameraNear/cameraFar nodes to use the shadow camera so we don't have to declare local ones here?
const cameraNearLocal = uniform( 'float' ).setGroup( renderGroup ).onRenderUpdate( () => shadow.camera.near );
const cameraFarLocal = uniform( 'float' ).setGroup( renderGroup ).onRenderUpdate( () => shadow.camera.far );
const cameraNearLocal = reference( 'near', 'float', shadow.camera ).setGroup( renderGroup );
const cameraFarLocal = reference( 'far', 'float', shadow.camera ).setGroup( renderGroup );

coordZ = viewZToLogarithmicDepth( w.negate(), cameraNearLocal, cameraFarLocal );

Expand Down

0 comments on commit 2277aa0

Please sign in to comment.