mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-10 17:18:44 +08:00
28 lines
750 B
HLSL
28 lines
750 B
HLSL
#ifndef SPRITES_SHADOW_CASTER_PASS_URP_INCLUDED
|
|
#define SPRITES_SHADOW_CASTER_PASS_URP_INCLUDED
|
|
|
|
#include "Spine-Common-ShadowCasterPass-URP.hlsl"
|
|
|
|
uniform fixed _ShadowAlphaCutoff;
|
|
|
|
VaryingsSpine ShadowPassVertexSprite(AttributesSpine input)
|
|
{
|
|
VaryingsSpine output;
|
|
UNITY_SETUP_INSTANCE_ID(input);
|
|
|
|
output.texcoordAndAlpha.xyz = float3(TRANSFORM_TEX(input.texcoord, _MainTex).xy, 0);
|
|
output.positionCS = GetShadowPositionHClip(input);
|
|
output.texcoordAndAlpha.a = input.vertexColor.a * _Color.a;
|
|
return output;
|
|
}
|
|
|
|
half4 ShadowPassFragmentSprite(VaryingsSpine input) : SV_TARGET
|
|
{
|
|
fixed4 texureColor = calculateTexturePixel(input.texcoordAndAlpha.xy);
|
|
clip(texureColor.a * input.texcoordAndAlpha.a - _ShadowAlphaCutoff);
|
|
|
|
return 0;
|
|
}
|
|
|
|
#endif
|