Now the built in bake_colors method will keep the original alpha in colors if set. Also Added uv2 support in build_mesh.

This commit is contained in:
Relintai 2020-02-13 03:25:47 +01:00
parent 3a8310c51f
commit 201ea0ce1f

View File

@ -109,6 +109,10 @@ void VoxelMesher::build_mesh(RID mesh) {
_surface_tool->add_uv(_uvs.get(i));
}
if (_uv2s.size() > 0) {
_surface_tool->add_uv2(_uv2s.get(i));
}
_surface_tool->add_vertex(_vertices.get(i));
}
@ -354,6 +358,9 @@ void VoxelMesher::_bake_colors(Node *p_chunk) {
if (_colors.size() < _vertices.size()) {
_colors.push_back(light);
} else {
Color c = _colors[i];
light.a = c.a;
_colors.set(i, light);
}
} else {