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:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2021-03-24 12:36:31 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2021-03-24 12:41:29 +0300
commit42198e9eb03bdc5494c3717c6b1643539ef06231 (patch)
treee41e4c8a230f3b3f50a5890872fd4dfadf428be5 /intern/cycles/render/geometry.cpp
parent6b18678e34bfbe2e95430fa7491ed1d3fad4ff3a (diff)
Fix T86601: Cycles accumulates displacement when transforming an Object
In order to update the BVH when only the transformations are changing, we would tag the Object's Geometry as modified. However, when displacement is used, and the vertices were not themselves modified, this would cause us to redo the displacement on already displaced vertices. To fix this, use a specific update flag for detecting and notifying that transformations were modified. Regression caused by rBbbe6d44928235cd4a5cfbeaf1a1de78ed861bb92.
Diffstat (limited to 'intern/cycles/render/geometry.cpp')
-rw-r--r--intern/cycles/render/geometry.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/intern/cycles/render/geometry.cpp b/intern/cycles/render/geometry.cpp
index e9a70e4b3fd..60a6f598ed2 100644
--- a/intern/cycles/render/geometry.cpp
+++ b/intern/cycles/render/geometry.cpp
@@ -1917,9 +1917,12 @@ void GeometryManager::device_update(Device *device,
}
}
- /* update the bvh even when there is no geometry so the kernel bvh data is still valid,
- * especially when removing all of the objects during interactive renders */
- bool need_update_scene_bvh = (scene->bvh == nullptr);
+ /* Update the BVH even when there is no geometry so the kernel's BVH data is still valid,
+ * especially when removing all of the objects during interactive renders.
+ * Also update the BVH if the transformations change, we cannot rely on tagging the Geometry
+ * as modified in this case, as we may accumulate displacement if the vertices do not also
+ * change. */
+ bool need_update_scene_bvh = (scene->bvh == nullptr || (update_flags & TRANSFORM_MODIFIED) != 0);
{
scoped_callback_timer timer([scene](double time) {
if (scene->update_stats) {