Skip to content

Commit

Permalink
WebGLRenderer: don't early return
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett committed May 20, 2024
1 parent a3f7e27 commit 3147249
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,9 @@ class WebGLRenderer {

const visible = object.layers.test( camera.layers );

if ( visible === false && object.layers.recursive === true ) return;
let stopTraversal = false;

if ( visible === false && object.layers.recursive === true ) stopTraversal = true;

if ( visible ) {

Expand Down Expand Up @@ -1389,11 +1391,15 @@ class WebGLRenderer {

}

const children = object.children;
if ( stopTraversal === false ) {

const children = object.children;

for ( let i = 0, l = children.length; i < l; i ++ ) {
for ( let i = 0, l = children.length; i < l; i ++ ) {

projectObject( children[ i ], camera, groupOrder, sortObjects );
projectObject( children[ i ], camera, groupOrder, sortObjects );

}

}

Expand Down

0 comments on commit 3147249

Please sign in to comment.