fix diffuse lit effect not discarding transparency
parent
3a0aa8894d
commit
51d7f3e772
BIN
Effects/FXB/DiffuseLitSpriteEffect.fxb (Stored with Git LFS)
BIN
Effects/FXB/DiffuseLitSpriteEffect.fxb (Stored with Git LFS)
Binary file not shown.
|
@ -98,6 +98,9 @@ float4 LightColor(float3 worldPosition, float3 worldNormal)
|
||||||
float4 WithoutNormalMap(PixelShaderInput input) : COLOR0
|
float4 WithoutNormalMap(PixelShaderInput input) : COLOR0
|
||||||
{
|
{
|
||||||
float4 tex = SAMPLE_TEXTURE(Texture, input.TexCoord);
|
float4 tex = SAMPLE_TEXTURE(Texture, input.TexCoord);
|
||||||
|
|
||||||
|
if (tex.a == 0.0) { discard; }
|
||||||
|
|
||||||
float3 normalWS = normalize(input.NormalWS);
|
float3 normalWS = normalize(input.NormalWS);
|
||||||
|
|
||||||
return tex * LightColor(input.PositionWS, normalWS);
|
return tex * LightColor(input.PositionWS, normalWS);
|
||||||
|
@ -106,6 +109,9 @@ float4 WithoutNormalMap(PixelShaderInput input) : COLOR0
|
||||||
float4 WithNormalMap(PixelShaderInput input) : COLOR0
|
float4 WithNormalMap(PixelShaderInput input) : COLOR0
|
||||||
{
|
{
|
||||||
float4 tex = SAMPLE_TEXTURE(Texture, input.TexCoord);
|
float4 tex = SAMPLE_TEXTURE(Texture, input.TexCoord);
|
||||||
|
|
||||||
|
if (tex.a == 0.0) { discard; }
|
||||||
|
|
||||||
float3 normalWS = GetNormalFromMap(input.PositionWS, input.TexCoord, input.NormalWS);
|
float3 normalWS = GetNormalFromMap(input.PositionWS, input.TexCoord, input.NormalWS);
|
||||||
|
|
||||||
return tex * LightColor(input.PositionWS, normalWS);
|
return tex * LightColor(input.PositionWS, normalWS);
|
||||||
|
|
Loading…
Reference in New Issue