Skip to content

Commit

Permalink
Merge pull request #14480 from BabylonJS/Popov72-patch-2
Browse files Browse the repository at this point in the history
ShaderMaterial: Make sure the color attribute is not duplicated
  • Loading branch information
sebavan committed Oct 31, 2023
2 parents eeb4a33 + f6660c0 commit c2de504
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/dev/core/src/Materials/shaderMaterial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,9 @@ export class ShaderMaterial extends PushMaterial {
}

if (mesh && mesh.isVerticesDataPresent(VertexBuffer.ColorKind)) {
attribs.push(VertexBuffer.ColorKind);
if (attribs.indexOf(VertexBuffer.ColorKind) === -1) {
attribs.push(VertexBuffer.ColorKind);
}
defines.push("#define VERTEXCOLOR");
}

Expand Down

0 comments on commit c2de504

Please sign in to comment.