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.
70 lines
1.9 KiB
70 lines
1.9 KiB
Pass
|
|
{
|
|
Name "DBufferMesh"
|
|
Tags {"LightMode"="DBufferVFX"}
|
|
|
|
|
|
Cull Front
|
|
ZWrite Off
|
|
ZTest Greater
|
|
|
|
|
|
// using alpha compositing https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch23.html
|
|
Blend 0 SrcAlpha OneMinusSrcAlpha, Zero OneMinusSrcAlpha
|
|
Blend 1 SrcAlpha OneMinusSrcAlpha, Zero OneMinusSrcAlpha
|
|
Blend 2 SrcAlpha OneMinusSrcAlpha, Zero OneMinusSrcAlpha
|
|
Blend 3 Zero OneMinusSrcColor
|
|
|
|
|
|
ColorMask ${VFXDecalColorMask0}
|
|
ColorMask ${VFXDecalColorMask1} 1
|
|
ColorMask ${VFXDecalColorMask2} 2
|
|
ColorMask ${VFXDecalColorMask3} 3
|
|
|
|
HLSLPROGRAM
|
|
#pragma target 4.5
|
|
#pragma multi_compile _ RENDERING_LAYERS
|
|
#pragma multi_compile _ DEBUG_DISPLAY
|
|
#pragma multi_compile_fragment DECALS_3RT DECALS_4RT
|
|
#pragma multi_compile_fragment _ DECAL_SURFACE_GRADIENT
|
|
|
|
#define UNITY_MATERIAL_LIT
|
|
|
|
${VFXIncludeRP("VFXDecalVaryings.template")}
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/Decal.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl"
|
|
|
|
|
|
|
|
struct ps_input
|
|
{
|
|
float4 pos : SV_POSITION;
|
|
${VFXHDRPDecalDeclareVaryings}
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
${VFXHDRPDecalVaryingsMacros}
|
|
|
|
${VFXBegin:VFXVertexAdditionalProcess}
|
|
${VFXHDRPDecalFillVaryings}
|
|
${VFXEnd}
|
|
|
|
|
|
${VFXInclude("Shaders/ParticleHexahedron/Pass.template")}
|
|
#define SHADERPASS SHADERPASS_VFX_DBUFFER_PROJECTOR
|
|
${VFXIncludeRP("VFXDecal.template")}
|
|
|
|
#pragma fragment frag
|
|
void frag(ps_input i, OUTPUT_DBUFFER(outDBuffer))
|
|
{
|
|
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
|
|
#if VFX_USE_GRAPH_VALUES
|
|
uint instanceActiveIndex = i.VFX_VARYINGS_INSTANCE_ACTIVE_INDEX;
|
|
${VFXLoadGraphValues}
|
|
#endif
|
|
//TODO Ludovic: pass graphValues here
|
|
VFXComputePixelOutputToDBuffer(i,outDBuffer);
|
|
}
|
|
ENDHLSL
|
|
}
|