Rasagar/Library/PackageCache/com.unity.visualeffectgraph/Shaders/ParticleSpheres/PassDepth.template
2024-08-26 23:07:20 +03:00

49 lines
982 B
Plaintext

// Forward pass
Pass
{
Name ${VFXPassDepth}
Tags { "LightMode"=${VFXPassDepth} }
HLSLPROGRAM
#pragma target 4.5
struct ps_input
{
SV_POSITION_QUALIFIERS float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
float3 posWS : TEXCOORD1;
float4 sphereInfo : TEXCOORD2;
UNITY_VERTEX_OUTPUT_STEREO
VFX_VERTEX_OUTPUT_INSTANCE_INDEX
};
struct ps_output
{
float depth : DEPTH_OFFSET_SEMANTIC;
};
#define VFX_VARYING_PS_INPUTS ps_input
#define VFX_VARYING_POSCS pos
#define VFX_VARYING_UV uv
#define VFX_VARYING_POSWS posWS
#define VFX_VARYING_SPHERECENTER sphereInfo.xyz
#define VFX_VARYING_SPHERERADIUS sphereInfo.w
${VFXPassDepthDefine}
${VFXInclude("Shaders/ParticleSpheres/Pass.template")}
#pragma fragment frag
ps_output frag(ps_input i)
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
VFXTransformPSInputs(i);
ps_output o = (ps_output)0;
float3 dummy;
VFXClipSphereAndGetDepthOffsetAndNormal(o.depth,dummy,i);
return o;
}
ENDHLSL
}