瀏覽代碼

WebGPURenderer: Allow using StorageBuffer directly as attribute in nodes (#28620)

Renaud Rohlinger 1 年之前
父節點
當前提交
b156ec846d
共有 1 個文件被更改,包括 9 次插入1 次删除
  1. 9 1
      examples/jsm/renderers/common/Geometries.js

+ 9 - 1
examples/jsm/renderers/common/Geometries.js

@@ -146,7 +146,15 @@ class Geometries extends DataMap {
 
 		for ( const attribute of attributes ) {
 
-			this.updateAttribute( attribute, AttributeType.VERTEX );
+			if ( attribute.isStorageBufferAttribute || attribute.isStorageInstancedBufferAttribute ) {
+
+				this.updateAttribute( attribute, AttributeType.STORAGE );
+
+			} else {
+
+				this.updateAttribute( attribute, AttributeType.VERTEX );
+
+			}
 
 		}