diff options
author | Graham Linden <graham@lindenlab.com> | 2013-07-25 12:13:21 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2013-07-25 12:13:21 -0700 |
commit | 3045dd6c5113d03fd0b0453ce916fc2a1c27c4e0 (patch) | |
tree | 61f327cc4b93a1b4a56eaac210a87068d42859e0 /indra/newview/app_settings/shaders/class1/deferred | |
parent | 6d21cd2ae1e8a32ccaf750a97199407fb1cacdef (diff) |
Make use of vertex_color selectable per shader with alphaF/alphaV again
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred')
-rwxr-xr-x | indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl | 11 | ||||
-rwxr-xr-x | indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl | 11 |
2 files changed, 19 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index 075699c591..52858f45f4 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -77,7 +77,10 @@ VARYING vec3 vary_fragcoord; VARYING vec3 vary_position; VARYING vec2 vary_texcoord0; VARYING vec3 vary_norm; + +#ifdef USE_VERTEX_COLOR VARYING vec4 vertex_color; +#endif vec3 vary_PositionEye; vec3 vary_SunlitColor; @@ -476,13 +479,17 @@ void main() #else vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy); #endif + +#ifdef USE_VERTEX_COLOR + float final_alpha = diff.a * vertex_color.a; diff.rgb *= vertex_color.rgb; +#else + float final_alpha = diff.a; +#endif vec4 gamma_diff = diff; diff.rgb = srgb_to_linear(diff.rgb); - float final_alpha = diff.a * vertex_color.a; - vec3 norm = vary_norm; calcAtmospherics(pos.xyz, 1.0); diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index 3696234af6..60d414f2ff 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -41,7 +41,10 @@ void passTextureIndex(); ATTRIBUTE vec3 normal; +#ifdef USE_VERTEX_COLOR ATTRIBUTE vec4 diffuse_color; +#endif + ATTRIBUTE vec2 texcoord0; #ifdef HAS_SKIN @@ -54,7 +57,11 @@ mat4 getSkinnedTransform(); VARYING vec3 vary_fragcoord; VARYING vec3 vary_position; + +#ifdef USE_VERTEX_COLOR VARYING vec4 vertex_color; +#endif + VARYING vec2 vary_texcoord0; VARYING vec3 vary_norm; @@ -112,8 +119,10 @@ void main() vary_norm = norm; vary_position = pos.xyz; +#ifdef USE_VERTEX_COLOR vertex_color = diffuse_color; - +#endif + #ifdef HAS_SKIN vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip); #else |