Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Eagar <joeedh@gmail.com>2022-06-27 21:15:44 +0300
committerThomas Dinges <blender@dingto.org>2022-06-28 16:08:20 +0300
commite0dd51fc14763b85ddb55d32cc5858f8338c79b5 (patch)
treeab9ebb7badc27f2fd75d3aee77d995e2c118862f
parente86fd862942b2eaeab0cbb9c3ab2f1b1c1365190 (diff)
Sculpt: Fix backwards normals in PBVH_GRIDS raycasting
Winding order of grid quads was backwards.
-rw-r--r--source/blender/blenkernel/intern/pbvh.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index 1d4fbb92fa0..640b532e417 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -2311,16 +2311,16 @@ static bool pbvh_grids_node_raycast(PBVH *pbvh,
const float *co[4];
if (origco) {
- co[0] = origco[y * gridsize + x];
- co[1] = origco[y * gridsize + x + 1];
- co[2] = origco[(y + 1) * gridsize + x + 1];
- co[3] = origco[(y + 1) * gridsize + x];
+ co[0] = origco[(y + 1) * gridsize + x];
+ co[1] = origco[(y + 1) * gridsize + x + 1];
+ co[2] = origco[y * gridsize + x + 1];
+ co[3] = origco[y * gridsize + x];
}
else {
- co[0] = CCG_grid_elem_co(gridkey, grid, x, y);
- co[1] = CCG_grid_elem_co(gridkey, grid, x + 1, y);
- co[2] = CCG_grid_elem_co(gridkey, grid, x + 1, y + 1);
- co[3] = CCG_grid_elem_co(gridkey, grid, x, y + 1);
+ co[0] = CCG_grid_elem_co(gridkey, grid, x, y + 1);
+ co[1] = CCG_grid_elem_co(gridkey, grid, x + 1, y + 1);
+ co[2] = CCG_grid_elem_co(gridkey, grid, x + 1, y);
+ co[3] = CCG_grid_elem_co(gridkey, grid, x, y);
}
if (ray_face_intersection_quad(