22 lines
568 B
HLSL
22 lines
568 B
HLSL
// XC_BUILTIN_SHADOW_CASTER_D3D12_PS
|
|
Texture2D gBaseColorTexture : register(t0);
|
|
SamplerState gLinearSampler : register(s0);
|
|
|
|
cbuffer MaterialConstants : register(b1) {
|
|
float4 gBaseColorFactor;
|
|
float4 gAlphaCutoffParams;
|
|
};
|
|
|
|
struct PSInput {
|
|
float4 position : SV_POSITION;
|
|
float2 texcoord : TEXCOORD0;
|
|
};
|
|
|
|
float MainPS(PSInput input) : SV_Depth {
|
|
#ifdef XC_ALPHA_TEST
|
|
float4 baseColor = gBaseColorTexture.Sample(gLinearSampler, input.texcoord) * gBaseColorFactor;
|
|
clip(baseColor.a - gAlphaCutoffParams.x);
|
|
#endif
|
|
return input.position.z;
|
|
}
|