Browse Source

NodeMaterial: Use type 'vec3' when getting color attribute, fixing crash (#27210)

in WebGPU.
Andreas Rosdal 1 năm trước cách đây
mục cha
commit
4c5c68f4c6
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      examples/jsm/nodes/materials/NodeMaterial.js

+ 1 - 1
examples/jsm/nodes/materials/NodeMaterial.js

@@ -160,7 +160,7 @@ class NodeMaterial extends ShaderMaterial {
 
 		if ( this.vertexColors === true && geometry.hasAttribute( 'color' ) ) {
 
-			colorNode = vec4( colorNode.xyz.mul( attribute( 'color' ) ), colorNode.a );
+			colorNode = vec4( colorNode.xyz.mul( attribute( 'color', 'vec3' ) ), colorNode.a );
 
 		}