Fix T86660 EEVEE: Undefined behaviour in specular_occlusion

Define visibility error to be 1 by default to avoid undefined behaviour.
This commit is contained in:
Clément Foucault 2021-03-20 21:58:04 +01:00
parent 057292e75a
commit 9ca67c47a1
Notes: blender-bot 2023-05-29 09:17:12 +02:00
Referenced by issue #86660, Undefined behaviour in specular_occlusion is visible on Apple M1
Referenced by issue #86615, Eevee glitches in latest update
1 changed files with 3 additions and 0 deletions

View File

@ -198,6 +198,9 @@ void occlusion_eval(OcclusionData data,
out float visibility_error,
out vec3 bent_normal)
{
/* No error by default. */
visibility_error = 1.0;
if ((int(aoSettings) & USE_AO) == 0) {
visibility = data.custom_occlusion;
bent_normal = N;