MAINT-622 Fix for broken alpha masking on avatar clothing when Lighting and Shadows enabled.

meow-7.2.2
Dave Parks 2012-05-30 14:44:39 -05:00
parent 2e26dc3971
commit 2207b979eb
3 changed files with 20 additions and 3 deletions

View File

@ -31,6 +31,8 @@ out vec4 frag_color;
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
uniform sampler2DRect depthMap;
uniform sampler2D diffuseMap;
@ -70,9 +72,15 @@ void main()
vec4 diff= texture2D(diffuseMap,vary_texcoord0.xy);
if (diff.a < minimum_alpha)
{
discard;
}
vec4 col = vec4(vary_ambient + vary_directional.rgb, 1.0);
vec4 color = diff * col;
color.rgb = atmosLighting(color.rgb);
color.rgb = scaleSoftClip(color.rgb);

View File

@ -31,6 +31,8 @@ out vec4 frag_color;
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
uniform sampler2DRectShadow shadowMap0;
uniform sampler2DRectShadow shadowMap1;
uniform sampler2DRectShadow shadowMap2;
@ -95,6 +97,13 @@ void main()
float shadow = 0.0;
vec4 pos = vec4(vary_position, 1.0);
vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy);
if (diff.a < minimum_alpha)
{
discard;
}
vec4 spos = pos;
if (spos.z > -shadow_clip.w)
@ -162,8 +171,6 @@ void main()
shadow = 1.0;
}
vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy);
vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, 1.0);
vec4 color = diff * col;

View File

@ -261,7 +261,9 @@ void LLDrawPoolAvatar::beginPostDeferredAlpha()
sRenderingSkinned = TRUE;
gPipeline.bindDeferredShader(*sVertexProgram);
sVertexProgram->setMinimumAlpha(0.2f);
sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
}