diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-08-13 15:30:24 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-08-13 15:30:47 +0300 |
commit | e3468d7ec2ce4be2ffc3e22bf86a6ace143c2f16 (patch) | |
tree | f0b9bbb048e62f9257e2cd7623667f40905a7ef5 /source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl | |
parent | 82e0419cc0592ad833ecab07532f50906be7a0b6 (diff) |
Eevee: Optimize and improve GTAO Horizon search
This fix a bug when occluder are on the edge of the screen and occludes more than they should.
Grouped the texture fetches together and clamp the ray at the border of the screen.
Also add a few util functions.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl index 267c52f0508..7dc047882c3 100644 --- a/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl @@ -283,8 +283,7 @@ vec4 get_ssr_sample( float mip = clamp(log2(cone_footprint * max(texture_size.x, texture_size.y)), 0.0, MAX_MIP); /* Correct UVs for mipmaping mis-alignment */ - float low_mip = floor(mip); - ref_uvs *= mix(mipRatio[int(low_mip)], mipRatio[int(low_mip + 1.0)], mip - low_mip); + ref_uvs *= mip_ratio_interp(mip); /* Slide 54 */ float bsdf = bsdf_ggx(N, L, V, roughnessSquared); |