Browse Source

instancenode: support non-dynamic matrices update (#28716)

Renaud Rohlinger 1 year ago
parent
commit
ee522dd393
1 changed files with 2 additions and 2 deletions
  1. 2 2
      examples/jsm/nodes/accessors/InstanceNode.js

+ 2 - 2
examples/jsm/nodes/accessors/InstanceNode.js

@@ -95,13 +95,13 @@ class InstanceNode extends Node {
 
 
 	update( /*frame*/ ) {
 	update( /*frame*/ ) {
 
 
-		if ( this.instanceMesh.instanceMatrix.version !== this.buffer.version ) {
+		if ( this.instanceMesh.instanceMatrix.usage !== DynamicDrawUsage && this.instanceMesh.instanceMatrix.version !== this.buffer.version ) {
 
 
 			this.buffer.version = this.instanceMesh.instanceMatrix.version;
 			this.buffer.version = this.instanceMesh.instanceMatrix.version;
 
 
 		}
 		}
 
 
-		if ( this.instanceMesh.instanceColor && this.instanceMesh.instanceColor.version !== this.bufferColor.version ) {
+		if ( this.instanceMesh.instanceColor && this.instanceMesh.instanceColor.usage !== DynamicDrawUsage && this.instanceMesh.instanceColor.version !== this.bufferColor.version ) {
 
 
 			this.bufferColor.version = this.instanceMesh.instanceColor.version;
 			this.bufferColor.version = this.instanceMesh.instanceColor.version;