[unity] Fixed Sprite pixel-lit shader incorrectly applying secondary lights. Closes #2147.

This commit is contained in:
Harald Csaszar 2022-09-06 17:25:54 +02:00
parent 6da33e5c88
commit e784103de9

View File

@ -222,6 +222,13 @@ fixed4 fragAdd(VertexOutput input) : SV_Target
ALPHA_CLIP(texureColor, input.color)
// previous fragBase pass was zwrite pass, so overlapping regions require
// full alpha applied since they are applied only once.
#if defined(_ALPHAPREMULTIPLY_ON)
texureColor.rgb /= texureColor.a == 0 ? 1 : texureColor.a;
#endif
texureColor.a = 1.0;
//Get normal direction
fixed3 normalWorld = calculateNormalWorld(input);