diff options
author | Merov Linden <merov@lindenlab.com> | 2013-06-19 14:06:06 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2013-06-19 14:06:06 -0700 |
commit | 7da4c651911743707c0cc7cd4bebdcefb52eb379 (patch) | |
tree | 6f99d83a2b2bf3de810dd5a1191a47f7cc53ac9d /indra/newview/app_settings/shaders/class1/deferred/waterF.glsl | |
parent | f1e594feceb8ab284e023e164d5410cd53a656cb (diff) | |
parent | 2655c7a17ae38a073dcf8f05b0127b68edc34c95 (diff) |
Pull merge from lindenlab/viewer-release
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/waterF.glsl')
-rwxr-xr-x | indra/newview/app_settings/shaders/class1/deferred/waterF.glsl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index 1ae006bc8a..daa2fb390a 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -67,6 +67,12 @@ VARYING vec4 littleWave; VARYING vec4 view; VARYING vec4 vary_position; +vec2 encode_normal(vec3 n) +{ + float f = sqrt(8 * n.z + 8); + return n.xy / f + 0.5; +} + void main() { vec4 color; @@ -161,5 +167,5 @@ void main() frag_data[0] = vec4(color.rgb, 0.5); // diffuse frag_data[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec - frag_data[2] = vec4(screenspacewavef.xyz*0.5+0.5, screenspacewavef.z*0.5); // normalxyz, displace + frag_data[2] = vec4(encode_normal(screenspacewavef), 0.0, 0.0); // normalxyz, displace } |