Просмотр исходного кода

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

Renaud Rohlinger 1 год назад
Родитель
Сommit
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 );
+
+			}
 
 		}
 

粤ICP备19079148号