summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-07-02 11:20:09 -0700
committerGraham Linden <graham@lindenlab.com>2019-07-02 11:20:09 -0700
commit7e5000bb64ca8eea3fe188ebb7bccff3bdfa82e7 (patch)
tree7350df57d466b4b9fc4ad2fe10e8d590207c1841 /indra/newview
parent576f1cdd7e16e44c43b39618f715753160045468 (diff)
SL-11533
Make alpha shader include vertex color modulation in both srgb and linear flavors.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl10
-rw-r--r--indra/newview/llviewershadermgr.cpp5
3 files changed, 3 insertions, 24 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 20dc03d7a5..15408b3475 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -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;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index 506118d381..619c4e9738 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
@@ -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);
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 55973aac2c..bd8064999f 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -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");