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:
authorLukas Tönne <lukas.toenne@gmail.com>2022-07-26 00:43:48 +0300
committerLukas Tönne <lukas.toenne@gmail.com>2022-07-26 00:43:48 +0300
commitf081e76037432cb926be45e980eac201d337032c (patch)
treedd1225521c12ea21c0b0c3d51ec1ae3f8730755f /source/blender/blenkernel/intern/pbvh.c
parentfa2084ae58a77b1201289b6bedac427f73c762d1 (diff)
parent462f99bf38648a08226b1fba423315aec2bc577b (diff)
Merge branch 'master' into geometry-nodes-iterative-cachegeometry-nodes-rigid-body-integration
Diffstat (limited to 'source/blender/blenkernel/intern/pbvh.c')
-rw-r--r--source/blender/blenkernel/intern/pbvh.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index 5e5443f48ca..6cebcdfea4e 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -1316,9 +1316,14 @@ static void pbvh_update_draw_buffer_cb(void *__restrict userdata,
if (node->flag & PBVH_RebuildDrawBuffers) {
switch (pbvh->type) {
- case PBVH_GRIDS:
- node->draw_buffers = GPU_pbvh_grid_buffers_build(node->totprim, pbvh->grid_hidden);
+ case PBVH_GRIDS: {
+ bool smooth = node->totprim > 0 ?
+ pbvh->grid_flag_mats[node->prim_indices[0]].flag & ME_SMOOTH :
+ false;
+
+ node->draw_buffers = GPU_pbvh_grid_buffers_build(node->totprim, pbvh->grid_hidden, smooth);
break;
+ }
case PBVH_FACES:
node->draw_buffers = GPU_pbvh_mesh_buffers_build(
pbvh->mpoly,
@@ -2419,7 +2424,7 @@ static bool pbvh_grids_node_raycast(PBVH *pbvh,
madd_v3_v3v3fl(location, ray_start, ray_normal, *depth);
const int x_it[4] = {0, 1, 1, 0};
- const int y_it[4] = {0, 0, 1, 1};
+ const int y_it[4] = {1, 1, 0, 0};
for (int j = 0; j < 4; j++) {
/* Always assign nearest_vertex_co in the first iteration to avoid comparison against