summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl16
1 files changed, 12 insertions, 4 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
index 21ddc2fad8..5dfbb91393 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
@@ -4,6 +4,8 @@
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$
*/
+
+#version 120
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
mat4 getSkinnedTransform();
@@ -17,10 +19,13 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
vec3 scaleDownLight(vec3 light);
vec3 scaleUpLight(vec3 light);
-varying vec4 vary_position;
+varying vec3 vary_position;
varying vec3 vary_ambient;
varying vec3 vary_directional;
varying vec3 vary_normal;
+varying vec3 vary_fragcoord;
+
+uniform float near_clip;
void main()
{
@@ -40,8 +45,10 @@ void main()
norm.z = dot(trans[2].xyz, gl_Normal);
norm = normalize(norm);
- gl_Position = gl_ProjectionMatrix * pos;
- vary_position = pos;
+ vec4 frag_pos = gl_ProjectionMatrix * pos;
+ gl_Position = frag_pos;
+
+ vary_position = pos.xyz;
vary_normal = norm;
calcAtmospherics(pos.xyz);
@@ -71,7 +78,8 @@ void main()
gl_FrontColor = col;
gl_FogFragCoord = pos.z;
-
+
+ vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip);
}