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).
This commit is contained in:
parent
3e5a354333
commit
65a3195781
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue