瀏覽代碼

WebGPUInfo: Honor instanceCount.

Mugen87 4 年之前
父節點
當前提交
2f73371f7b
共有 1 個文件被更改,包括 5 次插入5 次删除
  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 {