[Bf-blender-cvs] [bba11c68c40] blender-v2.83-release: Fix T75995: Cycles render artifacts with overlapping volumes
Brecht Van Lommel
noreply at git.blender.org
Fri May 1 23:53:17 CEST 2020
Commit: bba11c68c40480f525a23784ebca81d98e2ec6d2
Author: Brecht Van Lommel
Date: Fri May 1 23:42:42 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rBbba11c68c40480f525a23784ebca81d98e2ec6d2
Fix T75995: Cycles render artifacts with overlapping volumes
This is a workaround, but a proper solution requires significant changes to
ray intersection in the kernel.
===================================================================
M intern/cycles/render/mesh_volume.cpp
===================================================================
diff --git a/intern/cycles/render/mesh_volume.cpp b/intern/cycles/render/mesh_volume.cpp
index 74b8fc9e5ba..607363d01c6 100644
--- a/intern/cycles/render/mesh_volume.cpp
+++ b/intern/cycles/render/mesh_volume.cpp
@@ -19,6 +19,7 @@
#include "render/scene.h"
#include "util/util_foreach.h"
+#include "util/util_hash.h"
#include "util/util_logging.h"
#include "util/util_progress.h"
#include "util/util_types.h"
@@ -447,7 +448,14 @@ void GeometryManager::create_volume_mesh(Mesh *mesh, Progress &progress)
start_point = transform_point(&itfm, start_point);
cell_size = transform_direction(&itfm, cell_size);
- volume_params.start_point = start_point;
+ /* Slightly offset vertex coordinates to avoid overlapping faces with other
+ * volumes or meshes. The proper solution would be to improve intersection in
+ * the kernel to support robust handling of multiple overlapping faces or use
+ * an all-hit intersection similar to shadows. */
+ const float3 face_overlap_avoidance = cell_size * 0.1f *
+ hash_uint_to_float(hash_string(mesh->name.c_str()));
+
+ volume_params.start_point = start_point + face_overlap_avoidance;
volume_params.cell_size = cell_size;
volume_params.pad_size = pad_size;
More information about the Bf-blender-cvs
mailing list