diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2020-11-16 19:34:13 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2020-11-16 19:55:39 +0300 |
commit | 13ec512f4b9a9232d04a8995fab1837798ef4c39 (patch) | |
tree | 6bfe2a936ad96bc4023f263efe55dd24dc798520 /intern | |
parent | c645da98d8727e636c14383f4c10706c6cc5ead2 (diff) |
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
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/render/volume.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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); |