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

102 lines
2.6 KiB
Plaintext

#pragma target 4.5
#if SHADERGRAPH_NEEDS_NORMAL_DEPTHONLY || defined(WRITE_NORMAL_BUFFER) || FORCE_NORMAL_OUTPUT_UNLIT_VERTEX_SHADER
#define NEEDS_NORMAL 1
#endif
#if SHADERGRAPH_NEEDS_TANGENT_DEPTHONLY
#define NEEDS_TANGENT 1
#endif
struct ps_input
{
float4 pos : SV_POSITION;
#if USE_FLIPBOOK_INTERPOLATION
float4 uv : TEXCOORD0;
#else
#if USE_FLIPBOOK_ARRAY_LAYOUT
float3 uv : TEXCOORD0;
#else
float2 uv : TEXCOORD0;
#endif
#endif
#if USE_ALPHA_TEST || USE_FLIPBOOK_INTERPOLATION || VFX_USE_ALPHA_CURRENT
// x: alpha threshold
// y: frame blending factor
// z: alpha
VFX_OPTIONAL_INTERPOLATION float3 builtInInterpolants : TEXCOORD1;
#endif
#if USE_FLIPBOOK_MOTIONVECTORS
// x: motion vectors scale X
// y: motion vectors scale Y
VFX_OPTIONAL_INTERPOLATION float2 builtInInterpolants2 : TEXCOORD2;
#endif
#if VFX_PASSDEPTH == VFX_PASSDEPTH_MOTION_VECTOR
VFX_DECLARE_MOTION_VECTORS_STORAGE(3,4)
#endif
#if VFX_NEEDS_POSWS_INTERPOLATOR
float3 posWS : TEXCOORD5;
#endif
${VFXAdditionalInterpolantsDeclaration}
#if NEEDS_NORMAL
float3 normal : TEXCOORD6;
#endif
#if NEEDS_TANGENT
float4 tangent : TEXCOORD7;
#endif
UNITY_VERTEX_OUTPUT_STEREO
VFX_VERTEX_OUTPUT_INSTANCE_INDEX
};
#define VFX_VARYING_PS_INPUTS ps_input
#define VFX_VARYING_POSCS pos
#define VFX_VARYING_ALPHA builtInInterpolants.z
#define VFX_VARYING_ALPHATHRESHOLD builtInInterpolants.x
#define VFX_VARYING_FRAMEBLEND builtInInterpolants.y
#define VFX_VARYING_MOTIONVECTORSCALE builtInInterpolants2.xy
#define VFX_VARYING_UV uv
#if VFX_NEEDS_POSWS_INTERPOLATOR
#define VFX_VARYING_POSWS posWS
#endif
#if NEEDS_NORMAL
#define VFX_VARYING_NORMAL normal
#endif
#if NEEDS_TANGENT
#define VFX_VARYING_TANGENT tangent
#endif
#if VFX_PASSDEPTH == VFX_PASSDEPTH_MOTION_VECTOR
#define VFX_VARYING_VELOCITY_CPOS VFX_DECLARE_MOTION_VECTORS_VARYING_NONJITTER
#define VFX_VARYING_VELOCITY_CPOS_PREVIOUS VFX_DECLARE_MOTION_VECTORS_VARYING_PREVIOUS
#endif
#if VFX_PASSDEPTH == VFX_PASSDEPTH_MOTION_VECTOR
${VFXPassVelocityDefine}
#elif VFX_PASSDEPTH == VFX_PASSDEPTH_SHADOW
${VFXPassShadowDefine}
#elif VFX_PASSDEPTH == VFX_PASSDEPTH_ACTUAL || VFX_PASSDEPTH == VFX_PASSDEPTH_SELECTION || VFX_PASSDEPTH == VFX_PASSDEPTH_PICKING
${VFXPassDepthDefine}
#endif
${VFXBegin:VFXVertexAdditionalProcess}
#if VFX_PASSDEPTH == VFX_PASSDEPTH_SHADOW
float3 posWS = TransformPositionVFXToWorld(vPos);
VFXApplyShadowBias(o.VFX_VARYING_POSCS, posWS, normalWS);
#endif
${VFXEnd}
${VFXInclude("Shaders/ParticlePlanarPrimitives/Pass.template")}
#define VFX_SUPPORT_MAIN_TEXTURE_SAMPLING_IN_FRAGMENT_DEPTH 1
${VFXPassDepthCommonFragmentUnlit}