Files
Cielonos/Assets/OtherPlugins/GraphicsCat/Modules/LitPlus/Shaders/Includes/Passes/DepthOnlyPass.hlsl
SoulliesOfficial d15957c719 更新
2025-12-17 04:19:38 -05:00

39 lines
773 B
HLSL

#pragma once
#include "Includes/Common/Input.hlsl"
struct Attributes
{
float4 position : POSITION;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct Varyings
{
float2 uv : TEXCOORD0;
float4 positionCS : SV_POSITION;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
Varyings DepthOnlyVertex(Attributes input)
{
Varyings output = (Varyings)0;
UNITY_SETUP_INSTANCE_ID(input);
output.uv = TRANSFORM_TEX(input.texcoord, _BaseMap);
output.positionCS = TransformObjectToHClip(input.position.xyz);
return output;
}
half4 DepthOnlyFragment(Varyings input) : SV_TARGET
{
#if _ALPHATEST_ON
{
half alpha = tex2D(_BaseMap, input.uv).a * _BaseColor.a;
clip(alpha - _Cutoff);
}
#endif
return 0;
}