summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class2')
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl11
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl17
-rw-r--r--indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl7
4 files changed, 26 insertions, 13 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
index bc879948e4..bcce4c041a 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
@@ -129,6 +129,12 @@ vec4 getPosition(vec2 pos_screen);
void main()
{
+
+ vec3 col = vec3(0,0,0);
+
+#if defined(LOCAL_LIGHT_KILL)
+ discard;
+#else
vec4 frag = vary_fragcoord;
frag.xyz /= frag.w;
frag.xyz = frag.xyz*0.5+0.5;
@@ -183,8 +189,6 @@ void main()
lv = proj_origin-pos.xyz;
lv = normalize(lv);
float da = dot(norm, lv);
-
- vec3 col = vec3(0,0,0);
vec3 diff_tex = texture2DRect(diffuseRect, frag.xy).rgb;
@@ -284,10 +288,11 @@ void main()
}
}
}
+#endif
//not sure why, but this line prevents MATBUG-194
col = max(col, vec3(0.0));
-//col.rgb = vec3(0);
+
frag_color.rgb = col;
frag_color.a = 0.0;
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index 94abcf08ed..7f83e168bb 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -121,12 +121,16 @@ void main()
vec3 sun_contrib = min(scol, final_da) * sunlit;
+#if !defined(AMBIENT_KILL)
color.rgb = amblit;
color.rgb *= ambient;
+#endif
vec3 post_ambient = color.rgb;
+#if !defined(SUNLIGHT_KILL)
color.rgb += sun_contrib;
+#endif
vec3 post_sunlight = color.rgb;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
index 43f283bede..77f6e6f7ac 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
@@ -130,6 +130,11 @@ vec4 getPosition(vec2 pos_screen);
void main()
{
+ vec3 col = vec3(0,0,0);
+
+#if defined(LOCAL_LIGHT_KILL)
+ discard;
+#else
vec4 frag = vary_fragcoord;
frag.xyz /= frag.w;
frag.xyz = frag.xyz*0.5+0.5;
@@ -184,12 +189,8 @@ void main()
lv = normalize(lv);
float da = dot(norm, lv);
- vec3 col = vec3(0,0,0);
-
vec3 diff_tex = texture2DRect(diffuseRect, frag.xy).rgb;
-
vec4 spec = texture2DRect(specularRect, frag.xy);
-
vec3 dlit = vec3(0, 0, 0);
float noise = texture2D(noiseMap, frag.xy/128.0).b;
@@ -227,7 +228,6 @@ void main()
col += amb_da*color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
}
-
if (spec.a > 0.0)
{
@@ -253,10 +253,6 @@ void main()
col += speccol;
}
}
-
-
-
-
if (envIntensity > 0.0)
{
@@ -286,10 +282,11 @@ void main()
}
}
}
+#endif
//not sure why, but this line prevents MATBUG-194
col = max(col, vec3(0.0));
-//col.rgb = vec3(0);
+
frag_color.rgb = col;
frag_color.a = 0.0;
}
diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl
index 57f93a8b36..8795d69a3a 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl
@@ -44,9 +44,16 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color)
col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].z);
col.rgb = scaleDownLight(col.rgb);
+#if defined(LOCAL_LIGHT_KILL)
+ col.rgb = vec3(0);
+i#endif
+
// Add windlight lights
col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, light_position[0].xyz));
+#if !defined(SUNLIGHT_KILL)
col.rgb = min(col.rgb*color.rgb, 1.0);
+#endif
+
return col;
}