浏览代码

Clean up a bit

/RenderPassXR_Sandbox
Evgenii Golubev 8 年前
当前提交
67458b44
共有 1 个文件被更改,包括 22 次插入22 次删除
  1. 44
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/CombineSubsurfaceScattering.shader

44
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/CombineSubsurfaceScattering.shader


float4 Frag(Varyings input) : SV_Target
{
PositionInputs posInput = GetPositionInput(input.positionCS.xy, _ScreenSize.zw, uint2(0, 0));
PositionInputs posInput = GetPositionInput(input.positionCS.xy, _ScreenSize.zw);
float3 unused;

[branch]
if (maxDistancePixels < 0.5)
{
#if SSS_DEBUG
return float4(0, 0, 1, 1);
#else
return float4(bsdfData.diffuseColor * centerIrradiance, 1);
#endif
#if SSS_DEBUG
return float4(0, 0, 1, 1);
#else
return float4(bsdfData.diffuseColor * centerIrradiance, 1);
#endif
}
// Accumulate filtered irradiance and bilateral weights (for renormalization).

[branch]
if (maxDistancePixels < SSS_LOD_THRESHOLD)
{
#if SSS_DEBUG
return float4(0.5, 0.5, 0, 1);
#endif
SSS_LOOP(SSS_N_SAMPLES_FAR_FIELD, _FilterKernelsFarField,
profileID, shapeParam, centerPosition, centerPosVS.z,
millimPerUnit, scaledPixPerMm, rcp(distScale),
totalIrradiance, totalWeight)
#if SSS_DEBUG
return float4(0.5, 0.5, 0, 1);
#else
SSS_LOOP(SSS_N_SAMPLES_FAR_FIELD, _FilterKernelsFarField,
profileID, shapeParam, centerPosition, centerPosVS.z,
millimPerUnit, scaledPixPerMm, rcp(distScale),
totalIrradiance, totalWeight)
#endif
#if SSS_DEBUG
return float4(1, 0, 0, 1);
#endif
SSS_LOOP(SSS_N_SAMPLES_NEAR_FIELD, _FilterKernelsNearField,
profileID, shapeParam, centerPosition, centerPosVS.z,
millimPerUnit, scaledPixPerMm, rcp(distScale),
totalIrradiance, totalWeight)
#if SSS_DEBUG
return float4(1, 0, 0, 1);
#else
SSS_LOOP(SSS_N_SAMPLES_NEAR_FIELD, _FilterKernelsNearField,
profileID, shapeParam, centerPosition, centerPosVS.z,
millimPerUnit, scaledPixPerMm, rcp(distScale),
totalIrradiance, totalWeight)
#endif
}
return float4(bsdfData.diffuseColor * totalIrradiance / totalWeight, 1);

正在加载...
取消
保存