diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2021-03-20 23:58:04 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2021-03-21 00:00:08 +0300 |
commit | 9ca67c47a152a24e0740dbedc09a4bfeec2b6d73 (patch) | |
tree | 67b20ec4d63d58d8736d08e500f6761f08af07e2 /source/blender/draw/engines | |
parent | 057292e75ad2a9fa1d722f33c6c607ee33c1355c (diff) |
Fix T86660 EEVEE: Undefined behaviour in specular_occlusion
Define visibility error to be 1 by default to avoid undefined behaviour.
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl b/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl index dc5c048422b..69b9ecaf77d 100644 --- a/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl @@ -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; |