diff options
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
3 files changed, 13 insertions, 8 deletions
diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl index 2901e18db8..19203ab670 100644 --- a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl @@ -32,6 +32,7 @@ ATTRIBUTE vec2 texcoord0; VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; +uniform vec4 color; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); mat4 getSkinnedTransform(); @@ -61,8 +62,8 @@ void main() calcAtmospherics(pos.xyz); - vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0,0,0,0)); - vertex_color = color; + vec4 col = calcLighting(pos.xyz, norm, color, vec4(0,0,0,0)); + vertex_color = col; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl index acbc3f7e15..d7b90978ba 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl @@ -52,6 +52,8 @@ VARYING vec2 vary_texcoord0; uniform float near_clip; +uniform vec4 color; + uniform vec4 light_position[8]; uniform vec3 light_direction[8]; uniform vec3 light_attenuation[8]; @@ -123,17 +125,17 @@ void main() col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z); col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z); - vary_pointlight_col = col.rgb; + vary_pointlight_col = col.rgb*color.rgb; col.rgb = vec3(0,0,0); // Add windlight lights col.rgb = atmosAmbient(vec3(0.)); - vary_ambient = col.rgb; - vary_directional = atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0)); + vary_ambient = col.rgb*color.rgb; + vary_directional = color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0)); - col.rgb = min(col.rgb, 1.0); + col.rgb = col.rgb * color.rgb; vertex_color = col; diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl index 706627e175..0be52a52af 100644 --- a/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl @@ -28,6 +28,8 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; +uniform vec4 color; + ATTRIBUTE vec3 position; ATTRIBUTE vec3 normal; ATTRIBUTE vec2 texcoord0; @@ -50,8 +52,8 @@ void main() calcAtmospherics(pos.xyz); - vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.)); - vertex_color = color; + vec4 col = calcLighting(pos.xyz, norm, color, vec4(0.)); + vertex_color = col; } |