diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-10-20 22:59:04 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-10-20 23:06:43 +0300 |
commit | 65a3195781cbcca859b1f466f5395b226add4cb6 (patch) | |
tree | 8a4567b114da3ff629433a549e98af9efc1ce9ef /source/blender | |
parent | 3e5a354333adcaaf095b24777fd0d52f4d4bb75d (diff) |
EEVEE: Screen Space Reflection: Fix undefined behavior with invalid LOD
Some issues happened because the lod can become negative in some cases.
Also avoid sampling LOD with interpolation (floor).
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl b/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl index 22c306bb0fd..cad1346609a 100644 --- a/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl @@ -16,6 +16,7 @@ float sample_depth(vec2 uv, int index, float lod) } else { #endif + lod = clamp(floor(lod), 0.0, 8.0); /* Correct UVs for mipmaping mis-alignment */ uv *= mipRatio[int(lod) + hizMipOffset]; return textureLod(maxzBuffer, uv, lod).r; |