SL-11533
Make alpha shader include vertex color modulation in both srgb and linear flavors.meow-7.2.2
parent
576f1cdd7e
commit
7e5000bb64
|
|
@ -53,9 +53,7 @@ VARYING vec3 vary_position;
|
|||
VARYING vec2 vary_texcoord0;
|
||||
VARYING vec3 vary_norm;
|
||||
|
||||
#ifdef USE_VERTEX_COLOR
|
||||
VARYING vec4 vertex_color;
|
||||
#endif
|
||||
|
||||
uniform mat4 proj_mat;
|
||||
uniform mat4 inv_proj;
|
||||
|
|
@ -191,12 +189,9 @@ void main()
|
|||
color.rgb = diffuse_srgb.rgb;
|
||||
color.a = 1.0;
|
||||
|
||||
#ifdef USE_VERTEX_COLOR
|
||||
float final_alpha = diffuse_srgb.a * vertex_color.a;
|
||||
diffuse_srgb.rgb *= vertex_color.rgb;
|
||||
#else
|
||||
float final_alpha = diffuse_srgb.a;
|
||||
#endif
|
||||
diffuse_linear.rgb *= vertex_color.rgb;
|
||||
|
||||
// Insure we don't pollute depth with invis pixels in impostor rendering
|
||||
//
|
||||
|
|
@ -206,12 +201,9 @@ void main()
|
|||
}
|
||||
#else
|
||||
|
||||
#ifdef USE_VERTEX_COLOR
|
||||
float final_alpha = diffuse_linear.a * vertex_color.a;
|
||||
diffuse_srgb.rgb *= vertex_color.rgb;
|
||||
diffuse_linear.rgb *= vertex_color.rgb;
|
||||
#else
|
||||
float final_alpha = diffuse_linear.a;
|
||||
#endif
|
||||
|
||||
vec3 sunlit;
|
||||
vec3 amblit;
|
||||
|
|
|
|||
|
|
@ -40,11 +40,7 @@ void passTextureIndex();
|
|||
#endif
|
||||
|
||||
ATTRIBUTE vec3 normal;
|
||||
|
||||
#ifdef USE_VERTEX_COLOR
|
||||
ATTRIBUTE vec4 diffuse_color;
|
||||
#endif
|
||||
|
||||
ATTRIBUTE vec2 texcoord0;
|
||||
|
||||
#ifdef HAS_SKIN
|
||||
|
|
@ -57,11 +53,7 @@ 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;
|
||||
|
||||
|
|
@ -118,9 +110,7 @@ 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);
|
||||
|
|
|
|||
|
|
@ -1483,7 +1483,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
gDeferredSkinnedAlphaProgram.clearPermutations();
|
||||
gDeferredSkinnedAlphaProgram.addPermutation("USE_DIFFUSE_TEX", "1");
|
||||
gDeferredSkinnedAlphaProgram.addPermutation("HAS_SKIN", "1");
|
||||
gDeferredSkinnedAlphaProgram.addPermutation("USE_VERTEX_COLOR", "1");
|
||||
|
||||
if (use_sun_shadow)
|
||||
{
|
||||
gDeferredSkinnedAlphaProgram.addPermutation("HAS_SHADOW", "1");
|
||||
|
|
@ -1955,7 +1955,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
{
|
||||
gDeferredAlphaProgram.addPermutation("HAS_SHADOW", "1");
|
||||
}
|
||||
gDeferredAlphaProgram.addPermutation("USE_VERTEX_COLOR", "1");
|
||||
|
||||
if (ambient_kill)
|
||||
{
|
||||
|
|
@ -2010,7 +2009,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
|
||||
gDeferredAlphaImpostorProgram.clearPermutations();
|
||||
gDeferredAlphaImpostorProgram.addPermutation("USE_INDEXED_TEX", "1");
|
||||
gDeferredAlphaImpostorProgram.addPermutation("USE_VERTEX_COLOR", "1");
|
||||
gDeferredAlphaImpostorProgram.addPermutation("FOR_IMPOSTOR", "1");
|
||||
|
||||
if (use_sun_shadow)
|
||||
|
|
@ -2060,7 +2058,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
gDeferredAlphaWaterProgram.clearPermutations();
|
||||
gDeferredAlphaWaterProgram.addPermutation("USE_INDEXED_TEX", "1");
|
||||
gDeferredAlphaWaterProgram.addPermutation("WATER_FOG", "1");
|
||||
gDeferredAlphaWaterProgram.addPermutation("USE_VERTEX_COLOR", "1");
|
||||
if (use_sun_shadow)
|
||||
{
|
||||
gDeferredAlphaWaterProgram.addPermutation("HAS_SHADOW", "1");
|
||||
|
|
|
|||
Loading…
Reference in New Issue