diff options
author | Graham Linden <graham@lindenlab.com> | 2019-05-23 09:58:33 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-05-23 09:58:33 -0700 |
commit | d0a0eede63fdbd4ba597b86cbfbeb5b394ed2395 (patch) | |
tree | b84761e659eb528695b781cd973192c4b43634f1 /indra/newview/app_settings/shaders/class1/lighting | |
parent | 360b3230bbfbda7988eee84a8ed04fa1696ca70a (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/class1/lighting')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/lighting/lightV.glsl | 4 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl index cf635ffa3f..5e39d1629d 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl @@ -33,7 +33,11 @@ float getAmbientClamp(); vec4 calcLighting(vec3 pos, vec3 norm, vec4 color) { vec4 c = sumLights(pos, norm, color); + +#if !defined(AMBIENT_KILL) c.rgb += atmosAmbient() * color.rgb * 0.5 * getAmbientClamp(); +#endif + return c; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl index 761ac29ee2..0c3ea4231e 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl @@ -39,7 +39,15 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color) col.rgb = light_diffuse[1].rgb * calcDirectionalLight(norm, light_position[1].xyz); col.rgb = scaleDownLight(col.rgb); + +#if defined(LOCAL_LIGHT_KILL) + col.rgb = vec3(0); +#endif + +#if !defined(SUNLIGHT_KILL) col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, light_position[0].xyz)); +#endif + col.rgb = min(col.rgb*color.rgb, 1.0); return col; } |