浏览代码

Implement a more accurate heuristic to avoid the cost of SSS filtering

/Branch_Batching2
Evgenii Golubev 8 年前
当前提交
e42b32e9
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 9
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/CombineSubsurfaceScattering.shader

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


float3 sampleWeight = _FilterKernels[profileID][0].rgb;
float3 sampleIrradiance = LOAD_TEXTURE2D(_IrradianceSource, samplePosition).rgb;
// The max. value of the scattering distance is 2. We perform point sampling.
// Therefore, we do not need to perform filtering if (scaledStepSize * 2 < 0.5).
// This is a conservative estimate.
// We perform point sampling. Therefore, we can avoid the cost
// of filtering if we stay within the bounds of the current pixel.
float maxDistance = _FilterKernels[profileID][N_SAMPLES - 1].a;
if (scaledStepSize < 0.25)
if (scaledStepSize * maxDistance < 0.5)
{
return float4(albedoContrib * sampleIrradiance, 1);
}

正在加载...
取消
保存