Skip to content

Commit f64cea8

Browse files
kmatzenKevin Blackburn-Matzen
andauthored
fix missing morphtarget color attribute (#16738)
There's one color attribute declaration that is missing and will cause an error. --------- Co-authored-by: Kevin Blackburn-Matzen <[email protected]>
1 parent b83d857 commit f64cea8

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

packages/dev/core/src/Materials/materialHelper.functions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export function PrepareAttributesForMorphTargets(attribs: string[], mesh: Abstra
192192
const tangent = manager && manager.supportsTangents && defines["TANGENT"];
193193
const uv = manager && manager.supportsUVs && defines["UV1"];
194194
const uv2 = manager && manager.supportsUV2s && defines["UV2"];
195-
const color = manager && manager.supportsColors && defines["COLOR"];
195+
const color = manager && manager.supportsColors && defines["VERTEXCOLOR"];
196196
for (let index = 0; index < influencers; index++) {
197197
if (position) {
198198
attribs.push(Constants.PositionKind + index);

packages/dev/core/src/Shaders/ShadersInclude/morphTargetsVertexDeclaration.fx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
#ifdef MORPHTARGETS_UV2
2020
attribute vec2 uv2_{X};
2121
#endif
22+
23+
#ifdef MORPHTARGETS_COLOR
24+
attribute vec4 color{X};
25+
#endif
2226
#elif {X} == 0
2327
uniform int morphTargetCount;
2428
#endif
25-
#endif
29+
#endif

packages/dev/core/src/ShadersWGSL/ShadersInclude/morphTargetsVertexDeclaration.fx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
#ifdef MORPHTARGETS_UV2
2020
attribute uv2_{X} : vec2<f32>;
2121
#endif
22+
23+
#ifdef MORPHTARGETS_COLOR
24+
attribute color{X} : vec4<f32>;
25+
#endif
2226
#elif {X} == 0
2327
uniform morphTargetCount: i32;
2428
#endif
25-
#endif
29+
#endif

0 commit comments

Comments
 (0)