From 209c2d2c80184a86bfc4aa92b4a00236a302fd28 Mon Sep 17 00:00:00 2001 From: Leonard Date: Mon, 25 Mar 2019 21:27:55 -0700 Subject: [PATCH] Apply proper offset to CSGMesh material and smooth group --- modules/csg/csg_shape.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp index f274fff3f32..775ec67ba64 100644 --- a/modules/csg/csg_shape.cpp +++ b/modules/csg/csg_shape.cpp @@ -806,8 +806,8 @@ CSGBrush *CSGMesh::_build_brush() { uvw[as + j + 1] = uv[1]; uvw[as + j + 2] = uv[2]; - sw[j / 3] = !flat; - mw[j / 3] = mat; + sw[(as + j) / 3] = !flat; + mw[(as + j) / 3] = mat; } } else { int as = vertices.size(); @@ -849,8 +849,8 @@ CSGBrush *CSGMesh::_build_brush() { uvw[as + j + 1] = uv[1]; uvw[as + j + 2] = uv[2]; - sw[j / 3] = !flat; - mw[j / 3] = mat; + sw[(as + j) / 3] = !flat; + mw[(as + j) / 3] = mat; } } }