diff options
author | SmileTheory <SmileTheory@gmail.com> | 2016-03-10 03:44:21 -0800 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2016-04-07 11:54:14 +0100 |
commit | 46cb9a5112fecbdf152bccf692d89bfca564e987 (patch) | |
tree | 45ef8756f9fd27d1256500758ad01946ccbf90b6 /src/renderergl2/glsl/ssao_fp.glsl | |
parent | 026f8e89306cc9783c40d75f300c77ab8688cf9b (diff) |
OpenGL2: Fixes to depth blur and ssao.
Diffstat (limited to 'src/renderergl2/glsl/ssao_fp.glsl')
-rw-r--r-- | src/renderergl2/glsl/ssao_fp.glsl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/renderergl2/glsl/ssao_fp.glsl b/src/renderergl2/glsl/ssao_fp.glsl index 84f18cb7..1714c2be 100644 --- a/src/renderergl2/glsl/ssao_fp.glsl +++ b/src/renderergl2/glsl/ssao_fp.glsl @@ -40,7 +40,8 @@ mat2 randomRotation( const vec2 p ) float getLinearDepth(sampler2D depthMap, const vec2 tex, const float zFarDivZNear) { - float sampleZDivW = texture2D(depthMap, tex).r; + // depth is upside down? + float sampleZDivW = texture2D(depthMap, vec2(tex.x, 1.0 - tex.y)).r; return 1.0 / mix(zFarDivZNear, 1.0, sampleZDivW); } @@ -80,7 +81,7 @@ float ambientOcclusion(sampler2D depthMap, const vec2 tex, const float zFarDivZN void main() { - float result = ambientOcclusion(u_ScreenDepthMap, var_ScreenTex, u_ViewInfo.x, u_ViewInfo.y, u_ViewInfo.zw); + float result = ambientOcclusion(u_ScreenDepthMap, var_ScreenTex, u_ViewInfo.x, u_ViewInfo.y, u_ViewInfo.wz); gl_FragColor = vec4(vec3(result), 1.0); } |