Skip to content

Commit

Permalink
WebGLRenderer: Only update skeletons in frustum
Browse files Browse the repository at this point in the history
  • Loading branch information
ashconnell committed Apr 26, 2023
1 parent 8be4325 commit 42cc906
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1148,20 +1148,20 @@ class WebGLRenderer {

} else if ( object.isMesh || object.isLine || object.isPoints ) {

if ( object.isSkinnedMesh ) {
if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) {

// update skeleton only once in a frame
if ( object.isSkinnedMesh ) {

if ( object.skeleton.frame !== info.render.frame ) {
// update skeleton only once in a frame

object.skeleton.update();
object.skeleton.frame = info.render.frame;
if ( object.skeleton.frame !== info.render.frame ) {

}
object.skeleton.update();
object.skeleton.frame = info.render.frame;

}
}

if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) {
}

const geometry = objects.update( object );
const material = object.material;
Expand Down

0 comments on commit 42cc906

Please sign in to comment.