summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl25
1 files changed, 15 insertions, 10 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
index 25270f4939..99a277fbfc 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
@@ -23,9 +23,15 @@
* $/LicenseInfo$
*/
+#extension GL_ARB_texture_rectangle : enable
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor
+#endif
-#extension GL_ARB_texture_rectangle : enable
+VARYING vec4 vertex_color;
uniform sampler2DRect diffuseRect;
uniform sampler2DRect specularRect;
@@ -34,7 +40,6 @@ uniform sampler2DRect normalMap;
uniform samplerCube environmentMap;
uniform sampler2DRect lightMap;
uniform sampler2D noiseMap;
-uniform sampler2D lightFunc;
uniform sampler2D projectionMap;
uniform mat4 proj_mat; //screen space to light space
@@ -53,9 +58,9 @@ uniform float sun_wash;
uniform int proj_shadow_idx;
uniform float shadow_fade;
-varying vec4 vary_light;
+VARYING vec4 vary_light;
-varying vec4 vary_fragcoord;
+VARYING vec4 vary_fragcoord;
uniform vec2 screen_res;
uniform mat4 inv_proj;
@@ -114,7 +119,7 @@ void main()
proj_tc.xyz /= proj_tc.w;
- float fa = gl_Color.a+1.0;
+ float fa = vertex_color.a+1.0;
float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0);
lv = proj_origin-pos.xyz;
@@ -140,7 +145,7 @@ void main()
vec4 plcol = texture2DLod(projectionMap, proj_tc.xy, lod);
- vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a;
+ vec3 lcol = vertex_color.rgb * plcol.rgb * plcol.a;
lit = da * dist_atten * noise;
@@ -163,7 +168,7 @@ void main()
amb_da = min(amb_da, 1.0-lit);
- col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
+ col += amb_da*vertex_color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
}
@@ -192,12 +197,12 @@ void main()
stc.y > 0.0)
{
vec4 scol = texture2DLod(projectionMap, stc.xy, proj_lod-spec.a*proj_lod);
- col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb*shadow;
+ col += dist_atten*scol.rgb*vertex_color.rgb*scol.a*spec.rgb*shadow;
}
}
}
}
- gl_FragColor.rgb = col;
- gl_FragColor.a = 0.0;
+ frag_color.rgb = col;
+ frag_color.a = 0.0;
}