diff options
author | Graham Linden <graham@lindenlab.com> | 2018-11-09 18:31:29 +0000 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2018-11-09 18:31:29 +0000 |
commit | db270df7cc00c1e2519749831e7e98c2c10e3ee6 (patch) | |
tree | 7638f00884b1b2ec7ee4d08159ddcb967db9a928 /indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl | |
parent | 2929998982f37221a58b9fa8037748a2e905f4b1 (diff) |
Back out changes causing broken shadows and other render shenanigans.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index 022bcbabca..2b6428963d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -132,7 +132,18 @@ vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) } -vec4 getPosition(vec2 pos_screen); +vec4 getPosition(vec2 pos_screen) +{ + float depth = texture2DRect(depthMap, pos_screen.xy).r; + vec2 sc = pos_screen.xy*2.0; + sc /= screen_res; + sc -= vec2(1.0,1.0); + vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); + vec4 pos = inv_proj * ndc; + pos /= pos.w; + pos.w = 1.0; + return pos; +} void main() { |