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 dc58f21
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 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 ) {

// update skeleton only once in a frame
if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) {

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

// 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 dc58f21

Please sign in to comment.