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
This commit is contained in:
Kévin Dietrich 2020-11-16 17:34:13 +01:00
parent c645da98d8
commit 13ec512f4b
Notes: blender-bot 2023-02-13 20:46:26 +01:00
Referenced by issue #81983, Volume Displace blocky
1 changed files with 4 additions and 0 deletions

View File

@ -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);