You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.4 KiB
60 lines
1.4 KiB
Pass
|
|
{
|
|
Name "GBuffer"
|
|
Tags { "LightMode"="GBuffer" }
|
|
|
|
${VFXStencilGBuffer}
|
|
HLSLPROGRAM
|
|
#pragma target 4.5
|
|
|
|
#pragma multi_compile _ RENDERING_LAYERS
|
|
#pragma multi_compile _ DEBUG_DISPLAY
|
|
#pragma multi_compile _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2
|
|
|
|
#define UNITY_MATERIAL_LIT
|
|
|
|
${VFXIncludeRP("VFXLitVaryings.template")}
|
|
|
|
struct ps_input
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 pos : SV_POSITION;
|
|
|
|
${VFXHDRPLitDeclareVaryings}
|
|
|
|
float2 uv : TEXCOORD1;
|
|
float3 posWS : TEXCOORD2;
|
|
float4 sphereInfo : TEXCOORD3;
|
|
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
${VFXHDRPLitVaryingsMacros}
|
|
|
|
#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
|
|
|
|
${VFXBegin:VFXVertexAdditionalProcess}
|
|
${VFXHDRPLitFillVaryings}
|
|
${VFXEnd}
|
|
|
|
${VFXInclude("Shaders/ParticleSpheres/Pass.template")}
|
|
#define SHADERPASS SHADERPASS_GBUFFER
|
|
${VFXIncludeRP("VFXLit.template")}
|
|
|
|
#pragma fragment frag
|
|
void frag(ps_input i, OUTPUT_GBUFFER(outGBuffer), out float oDepth : DEPTH_OFFSET_SEMANTIC)
|
|
{
|
|
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
|
|
VFXTransformPSInputs(i);
|
|
VFX_FRAG_SETUP_INSTANCE_ID(i);
|
|
float3 normalWS;
|
|
VFXUVData uvData = (VFXUVData)0;
|
|
VFXClipSphereAndGetDepthOffsetAndNormal(oDepth, normalWS, i);
|
|
VFXComputePixelOutputToGBuffer(i,normalWS,uvData,outGBuffer);
|
|
}
|
|
ENDHLSL
|
|
}
|