Fix: EEVEE: VDB renders as bounding box when using Volume Scatter

Use the same approach as Cycles and only render the volume
objects if the shader is using any attribute.

Fix #124061
This commit is contained in:
Clément Foucault
2024-07-03 16:26:36 +02:00
parent 659e19607d
commit 71159872a4

View File

@@ -371,6 +371,13 @@ void SyncModule::sync_volume(Object *ob,
return;
}
/* Do not render the object if there is no attribute used in the volume.
* This mimic Cycles behavior (see #124061). */
ListBase attr_list = GPU_material_attributes(material.volume_material.gpumat);
if (BLI_listbase_is_empty(&attr_list)) {
return;
}
auto drawcall_add = [&](MaterialPass &matpass, gpu::Batch *geom, ResourceHandle res_handle) {
if (matpass.sub_pass == nullptr) {
return;