diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-05-27 12:34:05 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-05-27 12:34:05 +0100 |
commit | be6dc84b12c0c12975d8317604e5bff85fa14049 (patch) | |
tree | 8e79762251a307cedbac037ece893cf12b0ef9b2 /indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl | |
parent | e5273960de222ffae32405fde8e9fd566ff72d0a (diff) | |
parent | 94bddd2b4450674b9f121a10b97f0846b6a97d87 (diff) |
merge from viewer-public
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl index 02beddd43b..e32e9f4b32 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl @@ -31,7 +31,8 @@ float getDepth(vec2 pos_screen) void main() { - vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz*2.0-1.0; + vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz; + norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm float depth = getDepth(vary_fragcoord.xy); vec2 tc = vary_fragcoord.xy; @@ -46,8 +47,12 @@ void main() de = step(depth_cutoff, de); vec2 ne; - ne.x = dot(texture2DRect(normalMap, tc+vec2(-sc,-sc)).rgb*2.0-1.0, norm); - ne.y = dot(texture2DRect(normalMap, tc+vec2(sc,sc)).rgb*2.0-1.0, norm); + vec3 nexnorm = texture2DRect(normalMap, tc+vec2(-sc,-sc)).rgb; + nexnorm = vec3((nexnorm.xy-0.5)*2.0,nexnorm.z); // unpack norm + ne.x = dot(nexnorm, norm); + vec3 neynorm = texture2DRect(normalMap, tc+vec2(sc,sc)).rgb; + neynorm = vec3((neynorm.xy-0.5)*2.0,neynorm.z); // unpack norm + ne.y = dot(neynorm, norm); ne = 1.0-ne; |