Skip to content

Commit

Permalink
NodeMaterial: Use early out in setupDepth().
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 committed Nov 4, 2024
1 parent 9e5528d commit 2d17cef
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/materials/nodes/NodeMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,19 @@ class NodeMaterial extends Material {
setupDepth( builder ) {

const { renderer, camera } = builder;
const renderTarget = renderer.getRenderTarget();

// early out if not depth buffer is configured

if ( renderTarget !== null ) {

if ( renderTarget.depthBuffer === false ) return;

} else {

if ( renderer.depth === false ) return;

}

// Depth

Expand Down

0 comments on commit 2d17cef

Please sign in to comment.