From 4f99ace06944a704e46cc3014607f3a5a4ef246b Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sat, 17 Sep 2011 00:19:19 -0500 Subject: SH-2243 work in progress -- put back ambient lighting when atmospheric shaders disabled. --- indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl | 2 +- indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl | 3 ++- indra/newview/app_settings/shaders/class1/lighting/lightV.glsl | 3 ++- .../app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl index 15781bc92d..b07c1fda9b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl @@ -105,7 +105,7 @@ void main() vec4 frag_pos = projection_matrix * pos; gl_Position = frag_pos; - + GL vary_position = pos.xyz; vary_normal = norm; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl index bf6ed5988e..265d548ce9 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl @@ -26,6 +26,7 @@ uniform vec4 light_position[8]; uniform vec3 light_diffuse[8]; +uniform vec4 light_ambient; float calcDirectionalLight(vec3 n, vec3 l); @@ -36,7 +37,7 @@ vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularCo vec4 col; col.a = color.a; - col.rgb = baseCol.rgb; //need ambient? + col.rgb = baseCol.rgb + light_ambient.rgb; col.rgb += light_diffuse[0].rgb*calcDirectionalLight(norm, light_position[0].xyz); col.rgb += light_diffuse[1].rgb*calcDirectionalLight(norm, light_position[1].xyz); diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl index 79e2207932..b886f97743 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl @@ -26,6 +26,7 @@ uniform vec4 light_position[8]; uniform vec3 light_diffuse[8]; +uniform vec4 light_ambient; float calcDirectionalLight(vec3 n, vec3 l); @@ -34,7 +35,7 @@ vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) vec4 col; col.a = color.a; - col.rgb = baseLight.rgb; //need ambient? + col.rgb = baseLight.rgb+light_ambient.rgb; col.rgb += light_diffuse[0].rgb*calcDirectionalLight(norm, light_position[0].xyz); col.rgb += light_diffuse[1].rgb*calcDirectionalLight(norm, light_position[1].xyz); diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl index 9aa583afa1..ed0249330e 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl @@ -24,10 +24,11 @@ */ uniform vec3 light_diffuse[8]; +uniform vec4 light_ambient; vec3 atmosAmbient(vec3 light) { - return light; //need ambient? + return light + light_ambient.rgb; } vec3 atmosAffectDirectionalLight(float lightIntensity) -- cgit v1.2.3