From c48dfde6612cc83728a921ea2ebb949b20cb9f46 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 9 May 2020 21:24:23 +0200 Subject: [PATCH] Now the Transvoxel mesher will only interpolate between uv1 and uv2 at 3 steps (0, 0.5, 1). --- .../transvoxel_uv_mesher/voxel_mesher_uv_transvoxel.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/meshers/transvoxel_uv_mesher/voxel_mesher_uv_transvoxel.cpp b/meshers/transvoxel_uv_mesher/voxel_mesher_uv_transvoxel.cpp index 361807c..37776e3 100644 --- a/meshers/transvoxel_uv_mesher/voxel_mesher_uv_transvoxel.cpp +++ b/meshers/transvoxel_uv_mesher/voxel_mesher_uv_transvoxel.cpp @@ -282,8 +282,13 @@ void VoxelMesherUVTransvoxel::_add_chunk(Ref p_chunk) { float surface_ratio = 1.0; - if (type_id1 != type_id2) - surface_ratio = static_cast(type_id1c) / static_cast(type_id2c) / 8.0; + if (type_id1 != type_id2) { + if (type_id1c > 0 && type_id2c > 0) { + surface_ratio = 0.5; + } else { + surface_ratio = 0; + } + } Ref surface1 = _library->get_voxel_surface(type_id1 - 1); Ref surface2 = _library->get_voxel_surface(type_id2 - 1);