diff options
author | Patrick Mours <pmours@nvidia.com> | 2021-01-05 16:39:29 +0300 |
---|---|---|
committer | Patrick Mours <pmours@nvidia.com> | 2021-01-05 19:59:38 +0300 |
commit | 166c0db3f9412925b501b7172875cb8ee2eb6958 (patch) | |
tree | 90b87b06a9039d67384888f86708e08bf3e8f9f9 /intern/cycles/bvh | |
parent | da9d471e1d9ac451929340cfe8aa5a8c5b268a75 (diff) |
Fix T83915: Subdivision Surface modifier causes visual artifacts in Cycles rendered viewport - CPU and OptiX
Changing the geometry in the current scene caused the primitive offsets for all geometry to
change, but the values would not be updated in all bottom-level BVH structures. Rendering
artifacts and crashes where the result. This fixes that by ensuring all BVH structures are
updated when the primitive offsets change.
Diffstat (limited to 'intern/cycles/bvh')
-rw-r--r-- | intern/cycles/bvh/bvh_embree.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/intern/cycles/bvh/bvh_embree.cpp b/intern/cycles/bvh/bvh_embree.cpp index b874bda7186..c082478e5b1 100644 --- a/intern/cycles/bvh/bvh_embree.cpp +++ b/intern/cycles/bvh/bvh_embree.cpp @@ -682,6 +682,7 @@ void BVHEmbree::refit(Progress &progress) if (mesh->num_triangles() > 0) { RTCGeometry geom = rtcGetGeometry(scene, geom_id); set_tri_vertex_buffer(geom, mesh, true); + rtcSetGeometryUserData(geom, (void *)mesh->optix_prim_offset); rtcCommitGeometry(geom); } } @@ -690,6 +691,7 @@ void BVHEmbree::refit(Progress &progress) if (hair->num_curves() > 0) { RTCGeometry geom = rtcGetGeometry(scene, geom_id + 1); set_curve_vertex_buffer(geom, hair, true); + rtcSetGeometryUserData(geom, (void *)hair->optix_prim_offset); rtcCommitGeometry(geom); } } |