From 201ea0ce1f7e170affc911be60128ca807b246aa Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 13 Feb 2020 03:25:47 +0100 Subject: [PATCH] Now the built in bake_colors method will keep the original alpha in colors if set. Also Added uv2 support in build_mesh. --- meshers/voxel_mesher.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/meshers/voxel_mesher.cpp b/meshers/voxel_mesher.cpp index 9ffa704..c09e04a 100644 --- a/meshers/voxel_mesher.cpp +++ b/meshers/voxel_mesher.cpp @@ -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 {