Browse Source

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

in WebGPU.
Andreas Rosdal 1 year ago
parent
commit
4c5c68f4c6
1 changed files with 1 additions and 1 deletions
  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' ) ) {
 		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 );
 
 
 		}
 		}