Fix T69070 EEVEE: Volume shader glitch if object as axis with 0.0 scale

This commit is contained in:
Clément Foucault 2020-01-27 17:31:12 +01:00
parent 10eb711e16
commit 0366c46ec6
Notes: blender-bot 2023-02-14 01:05:26 +01:00
Referenced by issue #69070, Look-dev volume shader glitch (zero scale object volume)
1 changed files with 8 additions and 0 deletions

View File

@ -401,6 +401,14 @@ void EEVEE_volumes_cache_object_add(EEVEE_ViewLayerData *sldata,
return;
}
float size[3];
mat4_to_size(size, ob->obmat);
/* Check if any of the axes have 0 length. (see T69070) */
const float epsilon = 1e-8f;
if ((size[0] < epsilon) || (size[1] < epsilon) || (size[2] < epsilon)) {
return;
}
struct GPUMaterial *mat = EEVEE_material_mesh_volume_get(scene, ma);
eGPUMaterialStatus status = GPU_material_status(mat);