diff options
author | Graham Linden <graham@lindenlab.com> | 2018-09-18 17:53:35 +0100 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2018-09-18 17:53:35 +0100 |
commit | 53abfe53bd91e7d81ffbf037b807e2e8b226d2f2 (patch) | |
tree | d744145afe55335ea05ceaceae463d6616f248b3 /indra | |
parent | 32a147369e0f4979136b8d2a3fc57154a01c6935 (diff) |
SL-1835
Make attachmentAlphaMaskShadow frag shader ignore vert alpha which can be incorrect.
Make discard test in attachmentAlphaMaskShadow match other shadow shaders more closely.
Fix highlightF shader compile error.
Diffstat (limited to 'indra')
3 files changed, 16 insertions, 11 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaMaskShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaMaskShadowF.glsl index a08550d69c..c64b6ba240 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaMaskShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaMaskShadowF.glsl @@ -41,7 +41,7 @@ VARYING vec4 vertex_color; void main() { - float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a * vertex_color.a; + float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a; if (alpha < 0.05) // treat as totally transparent { @@ -50,7 +50,7 @@ void main() if (alpha < minimum_alpha) // treat as semi-transparent { - if (fract(0.5*floor(target_pos_x / pos_w )) < 0.25) + //if (fract(0.5*floor(target_pos_x / pos_w )) < 0.25) { discard; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl index 1adeb9237c..90566393d2 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl @@ -36,7 +36,7 @@ VARYING vec2 vary_texcoord0; void main() { - frag_data[0] = color*texture2D(diffuseMap, vary_texcoord0.xy)); + frag_data[0] = color*texture2D(diffuseMap, vary_texcoord0.xy); frag_data[1] = vec4(0.0); frag_data[2] = vec4(0.0, 1.0, 0.0, 1.0); } diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index a9df63debd..a2308b2529 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1807,6 +1807,9 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) S32 offset = face->getIndicesStart(); U32 count = face->getIndicesCount(); + U16 start = face->getGeomStart(); + U16 end = start + face->getGeomCount()-1; + LLDrawable* drawable = face->getDrawable(); if (!drawable) { @@ -1862,15 +1865,10 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) LLViewerTexture* tex = face->getTexture(LLRender::DIFFUSE_MAP); if (tex) { - LLGLenum image_format = tex->getPrimaryFormat(); if (tex->getIsAlphaMask()) { is_alpha_mask = true; } - else if (!is_alpha_mask && (image_format == GL_RGBA || image_format == GL_ALPHA)) - { - is_alpha_blend = true; - } } if (mat) @@ -1894,6 +1892,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) case LLMaterial::DIFFUSE_ALPHA_MODE_NONE: default: is_alpha_blend = false; + is_alpha_mask = false; break; } } @@ -1906,6 +1905,15 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) } } + if (tex) + { + LLGLenum image_format = tex->getPrimaryFormat(); + if (!is_alpha_mask && (image_format == GL_RGBA || image_format == GL_ALPHA)) + { + is_alpha_blend = true; + } + } + // if this is alpha mask content and we're doing opaques or a non-alpha-mask shadow pass... if (is_alpha_mask && (LLDrawPoolAvatar::sSkipTransparent || LLDrawPoolAvatar::sShadowPass != SHADOW_PASS_ATTACHMENT_ALPHA_MASK)) { @@ -1972,9 +1980,6 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) data_mask &= ~LLVertexBuffer::MAP_WEIGHT4; } - U16 start = face->getGeomStart(); - U16 end = start + face->getGeomCount()-1; - /*if (glow) { gGL.diffuseColor4f(0,0,0,face->getTextureEntry()->getGlow()); |