summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/deferred
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-05-23 09:58:33 -0700
committerGraham Linden <graham@lindenlab.com>2019-05-23 09:58:33 -0700
commitd0a0eede63fdbd4ba597b86cbfbeb5b394ed2395 (patch)
treeb84761e659eb528695b781cd973192c4b43634f1 /indra/newview/app_settings/shaders/class2/deferred
parent360b3230bbfbda7988eee84a8ed04fa1696ca70a (diff)
Add render debug controls for forcing disable of ambient, sun, and local light contributions
(engages AMBIENT_KILL, SUNLIGHT_KILL, and LOCAL_LIGHT_KILL defines in shaders to accomplish those tasks as required by each render mode).
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred')
-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
3 files changed, 19 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;
}