mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-05 02:06:53 +08:00
[unity] Corrected and unified Additive Slot behaviour of commit c5c7174 for URP and LWRP shaders (2D and 3D). Now only active for PMA blending and correctly performing alpha clip. See #1850.
This commit is contained in:
parent
47e357aa88
commit
d50cdef325
@ -212,11 +212,8 @@ half4 ForwardPassFragmentSprite(VertexOutputLWRP input) : SV_Target
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
|
||||
|
||||
fixed4 texureColor = calculateTexturePixel(input.texcoord.xy);
|
||||
RETURN_UNLIT_IF_ADDITIVE_SLOT(texureColor, input.vertexColor) // shall be called before ALPHA_CLIP
|
||||
ALPHA_CLIP(texureColor, input.vertexColor)
|
||||
#if !defined(_MULTIPLYBLEND) && !defined(_MULTIPLYBLEND_X2)
|
||||
if (input.vertexColor.a == 0)
|
||||
return texureColor * input.vertexColor;
|
||||
#endif
|
||||
|
||||
// fill out InputData struct
|
||||
InputData inputData;
|
||||
|
||||
@ -87,12 +87,10 @@ VertexOutputSpriteURP2D CombinedShapeLightVertex(VertexInput input)
|
||||
half4 CombinedShapeLightFragment(VertexOutputSpriteURP2D input) : SV_Target
|
||||
{
|
||||
fixed4 texureColor = calculateTexturePixel(input.texcoord.xy);
|
||||
RETURN_UNLIT_IF_ADDITIVE_SLOT(texureColor, input.vertexColor) // shall be called before ALPHA_CLIP
|
||||
ALPHA_CLIP(texureColor, input.vertexColor)
|
||||
|
||||
texureColor *= input.vertexColor;
|
||||
#if !defined(_MULTIPLYBLEND) && !defined(_MULTIPLYBLEND_X2)
|
||||
if (input.vertexColor.a == 0)
|
||||
return texureColor;
|
||||
#endif
|
||||
|
||||
half4 mask = SAMPLE_TEXTURE2D(_MaskTex, sampler_MaskTex, input.texcoord.xy);
|
||||
half4 pixel = CombinedShapeLightShared(texureColor, mask, input.lightingUV);
|
||||
|
||||
@ -222,11 +222,8 @@ half4 ForwardPassFragmentSprite(VertexOutputLWRP input) : SV_Target
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
|
||||
|
||||
fixed4 texureColor = calculateTexturePixel(input.texcoord.xy);
|
||||
RETURN_UNLIT_IF_ADDITIVE_SLOT(texureColor, input.vertexColor) // shall be called before ALPHA_CLIP
|
||||
ALPHA_CLIP(texureColor, input.vertexColor)
|
||||
#if !defined(_MULTIPLYBLEND) && !defined(_MULTIPLYBLEND_X2)
|
||||
if (input.vertexColor.a == 0)
|
||||
return texureColor * input.vertexColor;
|
||||
#endif
|
||||
|
||||
// fill out InputData struct
|
||||
InputData inputData;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user