39 lines
773 B
HLSL
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;
|
|
}
|