Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2021-03-14 00:48:56 +0300
committerClément Foucault <foucault.clem@gmail.com>2021-03-14 00:51:22 +0300
commit00baf875ef5f4b06d5a427eb6ef1d1132548fd51 (patch)
tree3b46df49a01b15aa2b548b99dd277a78551c245d
parent2c216413d5f0de6b4b35e0736964654206b72a02 (diff)
EEVEE: Planar reflections: Fix ambient occlusion broken in reflections
Use the maxzbuffer to get the correct depth information.
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_gtao_frag.glsl8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/effect_gtao_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_gtao_frag.glsl
index 16b1a7ffeaa..b76fa104c77 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_gtao_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_gtao_frag.glsl
@@ -10,6 +10,8 @@
* The final integration is done at the resolve stage with the shading normal.
*/
+in vec4 uvcoordsvar;
+
out vec4 FragColor;
uniform sampler2D normalBuffer;
@@ -79,8 +81,6 @@ bool reconstruct_view_position_and_normal_from_depth(vec2 texel, out vec3 vP, ou
#ifdef DEBUG_AO
-in vec4 uvcoordsvar;
-
void main()
{
vec3 vP, vNg;
@@ -112,8 +112,8 @@ void main()
void main()
{
- vec2 uvs = gl_FragCoord.xy / vec2(textureSize(gtao_depthBuffer, 0).xy);
- float depth = gtao_textureLod(gtao_depthBuffer, uvs, 0.0).r;
+ vec2 uvs = uvcoordsvar.xy;
+ float depth = textureLod(maxzBuffer, uvs * hizUvScale.xy, 0.0).r;
vec3 vP = get_view_space_from_depth(uvs, depth);
OcclusionData data = NO_OCCLUSION_DATA;