浏览代码

Modify SSS artifact clamping

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

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


// Perform integration over the screen-aligned plane in the view space.
// TODO: it would be more accurate to use the tangent plane in the world space.
int invalidSampleCount = 0;
int validSampleCount = 0;
[unroll]
for (uint i = 1; i < SSS_N_SAMPLES_NEAR_FIELD; i++)

if (rawDepth == 0)
{
// Our sample comes from a region without any geometry.
invalidSampleCount++;
continue;
}

// Our blur is energy-preserving, so 'sampleWeight' should be set to 0.
// We do not terminate the loop since we want to gather the contribution
// of the remaining samples (e.g. in case of hair covering skin).
invalidSampleCount++;
continue;
}

totalIrradiance += sampleWeight * sampleIrradiance;
totalWeight += sampleWeight;
validSampleCount++;
if (invalidSampleCount > SSS_N_SAMPLES_NEAR_FIELD / 2)
if (validSampleCount < SSS_N_SAMPLES_NEAR_FIELD / 2)
{
// Do not blur.
samplePosition = posInput.unPositionSS;

正在加载...
取消
保存