Skip to content

Commit a9db6c4

Browse files
committed
Fix vertex colors
1 parent 4d0e814 commit a9db6c4

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

paint/sources/make_mesh.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte
1414
};
1515
let con_mesh: node_shader_context_t = node_shader_context_create(data, props);
1616

17+
if (mesh_data_get_vertex_array(context_raw.paint_object.data, "col") != null) {
18+
node_shader_context_add_elem(con_mesh, "col", "short4norm");
19+
}
20+
1721
if (mesh_data_get_vertex_array(context_raw.paint_object.data, "tex1") != null) {
1822
node_shader_context_add_elem(con_mesh, "tex1", "short2norm");
1923
}

paint/sources/make_paint.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad
5454
};
5555
let con_paint: node_shader_context_t = node_shader_context_create(data, props);
5656

57+
if (mesh_data_get_vertex_array(context_raw.paint_object.data, "col") != null) {
58+
node_shader_context_add_elem(con_paint, "col", "short4norm");
59+
}
60+
5761
if (mesh_data_get_vertex_array(context_raw.paint_object.data, "tex1") != null) {
5862
node_shader_context_add_elem(con_paint, "tex1", "short2norm");
5963
}

0 commit comments

Comments
 (0)