diff options
author | James Canete <use.less01@gmail.com> | 2012-12-06 01:55:45 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-12 21:24:54 +0000 |
commit | 241a28e637799fef100619a74a8f88c2954e6754 (patch) | |
tree | edb915d7d901844a3d04646666515404201623b1 /src/rend2/glsl/shadowmask_fp.glsl | |
parent | 524bc5d77c1a8f8f2c25443c54ee74e73a5ca39b (diff) |
#5812 - Use refdef's coordinates when drawing to screen shadow fbo, and separate depth texture and screen texture coordinates in glsl shaders.
Diffstat (limited to 'src/rend2/glsl/shadowmask_fp.glsl')
-rw-r--r-- | src/rend2/glsl/shadowmask_fp.glsl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rend2/glsl/shadowmask_fp.glsl b/src/rend2/glsl/shadowmask_fp.glsl index 2736d26c..b3a698c8 100644 --- a/src/rend2/glsl/shadowmask_fp.glsl +++ b/src/rend2/glsl/shadowmask_fp.glsl @@ -15,7 +15,7 @@ uniform mat4 u_ShadowMvp3; uniform vec3 u_ViewOrigin; uniform vec4 u_ViewInfo; // zfar / znear, zfar -varying vec2 var_ScreenTex; +varying vec2 var_DepthTex; varying vec3 var_ViewDir; // Input: It uses texture coords as the random number seed. @@ -41,7 +41,7 @@ float PCF(const sampler2D shadowmap, const vec2 st, const float dist) float scale = 2.0 / r_shadowMapSize; #if defined(USE_SHADOW_FILTER) - float r = random(var_ScreenTex.xy); + float r = random(var_DepthTex.xy); float sinr = sin(r) * scale; float cosr = cos(r) * scale; mat2 rmat = mat2(cosr, sinr, -sinr, cosr); @@ -78,7 +78,7 @@ void main() { float result; - float depth = getLinearDepth(u_ScreenDepthMap, var_ScreenTex, u_ViewInfo.x); + float depth = getLinearDepth(u_ScreenDepthMap, var_DepthTex, u_ViewInfo.x); float sampleZ = u_ViewInfo.y * depth; vec4 biasPos = vec4(u_ViewOrigin + var_ViewDir * depth * 0.99, 1.0); |