summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2014-03-04 13:15:43 -0500
committerOz Linden <oz@lindenlab.com>2014-03-04 13:15:43 -0500
commita373a7442c244712ab17d793072699ef82684816 (patch)
tree2ed20e24993c4bfbb4f943ed7794fcd06eeb8a23 /indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
parentb0c255f4e6141246f3575cb3d5b671af19966de9 (diff)
parentde8fea13627cc5978b8a6135802a52864a11c39a (diff)
merge changes for 3.7.2-release
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl')
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/alphaV.glsl84
1 files changed, 1 insertions, 83 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index 9d3ba564cd..b40785bbd7 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
@@ -55,67 +55,18 @@ mat4 getSkinnedTransform();
#endif
#endif
-vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
-void calcAtmospherics(vec3 inPositionEye);
-
-vec3 atmosAmbient(vec3 light);
-vec3 atmosAffectDirectionalLight(float lightIntensity);
-vec3 scaleDownLight(vec3 light);
-vec3 scaleUpLight(vec3 light);
-
-VARYING vec3 vary_ambient;
-VARYING vec3 vary_directional;
VARYING vec3 vary_fragcoord;
VARYING vec3 vary_position;
-VARYING vec3 vary_pointlight_col;
#ifdef USE_VERTEX_COLOR
VARYING vec4 vertex_color;
#endif
VARYING vec2 vary_texcoord0;
-
VARYING vec3 vary_norm;
uniform float near_clip;
-uniform vec4 light_position[8];
-uniform vec3 light_direction[8];
-uniform vec3 light_attenuation[8];
-uniform vec3 light_diffuse[8];
-
-uniform vec3 sun_dir;
-
-vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
-{
- //get light vector
- vec3 lv = lp.xyz-v;
-
- //get distance
- float d = dot(lv,lv);
-
- float da = 0.0;
-
- if (d > 0.0 && la > 0.0 && fa > 0.0)
- {
- //normalize light vector
- lv = normalize(lv);
-
- //distance attenuation
- float dist2 = d/la;
- da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0);
-
- // spotlight coefficient.
- float spot = max(dot(-ln, lv), is_pointlight);
- da *= spot*spot; // GL_SPOT_EXPONENT=2
-
- //angular attenuation
- da *= max(dot(n, lv), 0.0);
- }
-
- return vec3(da,da,da);
-}
-
void main()
{
vec4 pos;
@@ -168,41 +119,8 @@ void main()
vary_norm = norm;
vary_position = pos.xyz;
- calcAtmospherics(pos.xyz);
-
-#ifndef USE_VERTEX_COLOR
- vec4 diffuse_color = vec4(1,1,1,1);
-#endif
- //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
- vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
-
- vec3 diff = diffuse_color.rgb;
-
-
-
- vary_pointlight_col = diff;
-
-
- col.rgb = vec3(0,0,0);
-
- // Add windlight lights
- col.rgb = atmosAmbient(col.rgb);
-
- float ambient = min(abs(dot(norm.xyz, sun_dir.xyz)), 1.0);
- ambient *= 0.5;
- ambient *= ambient;
- ambient = (1.0-ambient);
-
- col.rgb *= ambient;
-
- vary_ambient = col.rgb*diff.rgb;
-
- vary_directional.rgb = atmosAffectDirectionalLight(1.0f);
-
- col.rgb = col.rgb*diff.rgb;
-
#ifdef USE_VERTEX_COLOR
- vertex_color = col;
+ vertex_color = diffuse_color;
#endif
#ifdef HAS_SKIN