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.
 
 
 
 
 

62 lines
1.4 KiB

Pass
{
Name "DecalMeshForwardEmissive"
Tags {"LightMode"="DecalMeshForwardEmissive"}
ZWrite Off
ZTest LEqual
Blend 0 SrcAlpha One
HLSLPROGRAM
#pragma target 4.5
#pragma multi_compile _ RENDERING_LAYERS
#pragma multi_compile _ DEBUG_DISPLAY
#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"
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_DECAL_FORWARD_EMISSIVE
${VFXIncludeRP("VFXDecal.template")}
#pragma fragment frag
void frag(ps_input i, out float4 outEmissive : SV_Target0)
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
#if VFX_USE_GRAPH_VALUES
uint instanceActiveIndex = i.VFX_VARYINGS_INSTANCE_ACTIVE_INDEX;
${VFXLoadGraphValues}
#endif
DecalSurfaceData surfaceData;
ZERO_INITIALIZE(DecalSurfaceData, surfaceData);
//TODO Ludovic : Pass graphValues here
VFXGetSurfaceDecalData(surfaceData,i);
outEmissive.rgb = surfaceData.emissive * GetCurrentExposureMultiplier();
outEmissive.a = 1.0f;
}
ENDHLSL
}