From 766e3d882cdbacd2b296ed28ddcb00e98578efd9 Mon Sep 17 00:00:00 2001 From: Marc Gilleron Date: Sun, 28 Apr 2019 03:51:24 +0100 Subject: [PATCH] Subtract should actually use inverted signed distance --- voxel_isosurface_tool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/voxel_isosurface_tool.cpp b/voxel_isosurface_tool.cpp index 09ccc10..59af720 100644 --- a/voxel_isosurface_tool.cpp +++ b/voxel_isosurface_tool.cpp @@ -42,7 +42,7 @@ inline void do_op(VoxelBuffer &buffer, int x, int y, int z, float d1, VoxelIsoSu break; case VoxelIsoSurfaceTool::OP_SUBTRACT: - res = MAX(d1, buffer.get_voxel_iso(x, y, z, VoxelBuffer::CHANNEL_ISOLEVEL)); + res = MAX(1.0 - d1, buffer.get_voxel_iso(x, y, z, VoxelBuffer::CHANNEL_ISOLEVEL)); break; case VoxelIsoSurfaceTool::OP_SET: