Răsfoiți Sursa

WebGPUInfo: Honor instanceCount.

Mugen87 4 ani în urmă
părinte
comite
2f73371f7b
1 a modificat fișierele cu 5 adăugiri și 5 ștergeri
  1. 5 5
      examples/jsm/renderers/webgpu/WebGPUInfo.js

+ 5 - 5
examples/jsm/renderers/webgpu/WebGPUInfo.js

@@ -19,25 +19,25 @@ class WebGPUInfo {
 
 	}
 
-	update( object, count ) {
+	update( object, count, instanceCount = 1 ) {
 
 		this.render.drawCalls ++;
 
 		if ( object.isMesh ) {
 
-			this.render.triangles += ( count / 3 );
+			this.render.triangles += instanceCount * ( count / 3 );
 
 		} else if ( object.isPoints ) {
 
-			this.render.points += count;
+			this.render.points += instanceCount * count;
 
 		} else if ( object.isLineSegments ) {
 
-			this.render.lines += ( count / 2 );
+			this.render.lines += instanceCount * ( count / 2 );
 
 		} else if ( object.isLine ) {
 
-			this.render.lines += ( count - 1 );
+			this.render.lines += instanceCount * ( count - 1 );
 
 		} else {