Commit: 13ec512f4b9a9232d04a8995fab1837798ef4c39
Author: Kévin Dietrich
Date:   Mon Nov 16 17:34:13 2020 +0100
Branches: blender-v2.91-release
https://developer.blender.org/rB13ec512f4b9a9232d04a8995fab1837798ef4c39

Fix T81983: volume tiles missing in Cycles renders

The OpenVDB data structure can store voxel data in leaf nodes or tiles
when all the nodes in a given region have a constant value. However,
Cycles is using the leaf nodes to generate the acceleration structure
for computing volume intersections which did not include constant tiles.

To fix this, we simply voxelize all the active tiles prior to generating
the volume bounding mesh. As we are using a MaskGrid, this will not
allocate actual voxel buffers for each leaf, so the memory usage will be
kept low.

Differential Revision: https://developer.blender.org/D9557

Reviewed by: brecht, JacquesLucke

===================================================================

M       intern/cycles/render/volume.cpp

===================================================================

diff --git a/intern/cycles/render/volume.cpp b/intern/cycles/render/volume.cpp
index 9e633b27cc9..ebb9752756e 100644
--- a/intern/cycles/render/volume.cpp
+++ b/intern/cycles/render/volume.cpp
@@ -289,6 +289,10 @@ void VolumeMeshBuilder::create_mesh(vector<float3> 
&vertices,
   vector<int3> vertices_is;
   vector<QuadData> quads;
 
+  /* make sure we only have leaf nodes in the tree, as tiles are not handled by
+   * this algorithm */
+  topology_grid->tree().voxelizeActiveTiles();
+
   generate_vertices_and_quads(vertices_is, quads);
 
   convert_object_space(vertices_is, vertices, face_overlap_avoidance);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to