diff options
author | Graham Madarasz <graham@lindenlab.com> | 2013-05-01 08:11:15 -0700 |
---|---|---|
committer | Graham Madarasz <graham@lindenlab.com> | 2013-05-01 08:11:15 -0700 |
commit | 025c8909582f59f68f786d52bea06f5a272df0b5 (patch) | |
tree | 6d9980e216f89c74776155432b32e6778f3b6367 /indra/newview/app_settings/shaders/class1/environment | |
parent | 536a30d7f2083d39dbd6d06f16fa53064c3ee379 (diff) | |
parent | 70c1e21956b8589c9873ac5fa6a05467dc2e0a89 (diff) |
Merge vwr-dev-mat
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/environment')
-rwxr-xr-x | indra/newview/app_settings/shaders/class1/environment/waterV.glsl | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl index 5aff156eae..a2a567eff1 100755 --- a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl @@ -49,40 +49,41 @@ float wave(vec2 v, float t, float f, vec2 d, float s) void main() { //transform vertex - vec4 pos = vec4(position.xyz, 1.0); mat4 modelViewProj = modelview_projection_matrix; vec4 oPosition; //get view vector vec3 oEyeVec; - oEyeVec.xyz = pos.xyz-eyeVec; + oEyeVec.xyz = position.xyz-eyeVec; float d = length(oEyeVec.xy); float ld = min(d, 2560.0); - pos.xy = eyeVec.xy + oEyeVec.xy/d*ld; + vec3 lpos = position; + lpos.xy = eyeVec.xy + oEyeVec.xy/d*ld; view.xyz = oEyeVec; d = clamp(ld/1536.0-0.5, 0.0, 1.0); d *= d; - oPosition = vec4(position, 1.0); + oPosition = vec4(lpos, 1.0); oPosition.z = mix(oPosition.z, max(eyeVec.z*0.75, 0.0), d); oPosition = modelViewProj * oPosition; - refCoord.xyz = oPosition.xyz + vec3(0,0,0.2); //get wave position parameter (create sweeping horizontal waves) - vec3 v = pos.xyz; + vec3 v = lpos; v.x += (cos(v.x*0.08/*+time*0.01*/)+sin(v.y*0.02))*6.0; //push position for further horizon effect. + vec4 pos; pos.xyz = oEyeVec.xyz*(waterHeight/oEyeVec.z); pos.w = 1.0; pos = modelview_matrix*pos; - calcAtmospherics(view.xyz); + calcAtmospherics(pos.xyz); + //pass wave parameters to pixel shader vec2 bigWave = (v.xy) * vec2(0.04,0.04) + d1 * time * 0.055; |