diff options
author | Dessie Linden <dessie@lindenlab.com> | 2010-06-11 11:51:14 -0700 |
---|---|---|
committer | Dessie Linden <dessie@lindenlab.com> | 2010-06-11 11:51:14 -0700 |
commit | 8ea4802251cbfb4fcf112f597f4a4ff1ab0d3f1f (patch) | |
tree | 74db74b999f98cbe200d9c9e3eb1c9f58fad0062 /indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl | |
parent | af4a2ec0f9f4e51e186f4b386b4465f6e107b63b (diff) | |
parent | a0de40ddfa0cd318cb0b67e72e1739a706ff3a85 (diff) |
Merge
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; |