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.
53 lines
2.3 KiB
53 lines
2.3 KiB
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/VFXLit.hlsl"
|
|
|
|
#ifndef VFX_SHADERGRAPH
|
|
|
|
|
|
void VFXGetHDRPLitData(out SurfaceData surfaceData, out BuiltinData builtinData, out BSDFData bsdfData, out PreLightData preLightData, VFX_VARYING_PS_INPUTS i, float3 normalWS, PositionInputs posInput, const VFXUVData uvData, bool frontFace, uint2 tileIndex)
|
|
{
|
|
#if HDRP_MATERIAL_TYPE_TRANSLUCENT
|
|
${VFXLoadParameter:{diffusionProfileHash}} // Loads diffusion profile
|
|
#else
|
|
const uint diffusionProfileHash = 0;
|
|
#endif
|
|
float alpha;
|
|
surfaceData = VFXGetSurfaceData(i,normalWS,uvData,diffusionProfileHash,frontFace,alpha);
|
|
bsdfData = ConvertSurfaceDataToBSDFData(posInput.positionSS.xy, surfaceData);
|
|
#if defined(SHADER_STAGE_RAY_TRACING)
|
|
preLightData = GetPreLightData(-WorldRayDirection(),posInput,bsdfData);
|
|
#else
|
|
preLightData = GetPreLightData(GetWorldSpaceNormalizeViewDir(posInput.positionWS),posInput,bsdfData);
|
|
#endif
|
|
#ifndef VFX_MATERIAL_TYPE_SIX_WAY_SMOKE
|
|
preLightData.diffuseFGD = 1.0f;
|
|
//TODO: investigate why this is needed
|
|
preLightData.coatPartLambdaV = 0;
|
|
preLightData.coatIblR = 0;
|
|
preLightData.coatIblF = 0;
|
|
#endif
|
|
|
|
builtinData = VFXGetBuiltinData(i,posInput,surfaceData,uvData,alpha);
|
|
}
|
|
|
|
void VFXGetHDRPLitData(out SurfaceData surfaceData, out BuiltinData builtinData, out BSDFData bsdfData, out PreLightData preLightData, VFX_VARYING_PS_INPUTS i, float3 normalWS, const VFXUVData uvData, bool frontFace, uint2 tileIndex)
|
|
{
|
|
float3 posRWS = VFXGetPositionRWS(i);
|
|
float4 posSS = i.VFX_VARYING_POSCS;
|
|
PositionInputs posInput = GetPositionInput(posSS.xy, _ScreenSize.zw, posSS.z, posSS.w, posRWS, tileIndex);
|
|
|
|
VFXGetHDRPLitData(surfaceData, builtinData, bsdfData, preLightData, i, normalWS, posInput, uvData, frontFace, 0);
|
|
}
|
|
|
|
void VFXGetHDRPLitData(out SurfaceData surfaceData, out BuiltinData builtinData, VFX_VARYING_PS_INPUTS i, float3 normalWS, const VFXUVData uvData)
|
|
{
|
|
BSDFData bsdfData = (BSDFData)0;
|
|
PreLightData preLightData = (PreLightData)0;
|
|
VFXGetHDRPLitData(surfaceData,builtinData,bsdfData,preLightData,i,normalWS,uvData, true, uint2(0,0));
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/VFXLitPixelOutput.hlsl"
|
|
|