浏览代码

Fix the sample count bug

/main
Evgenii Golubev 7 年前
当前提交
8e2d18df
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 7
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/SubsurfaceScattering/SubsurfaceScattering.compute

7
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/SubsurfaceScattering/SubsurfaceScattering.compute


// Compute the indices used to access the individual components of the float4 of the kernel.
uint iR = useNearFieldKernel ? 0 : 2; // radius
uint iP = useNearFieldKernel ? 1 : 3; // rcp(pdf)
uint n = useNearFieldKernel ? SSS_N_SAMPLES_NEAR_FIELD : SSS_N_SAMPLES_FAR_FIELD;
float centerRadius = _FilterKernels[profileID][0][iR];
float centerRcpPdf = _FilterKernels[profileID][0][iP];

float3 totalIrradiance = centerWeight * centerIrradiance;
float3 totalWeight = centerWeight;
int i, n; // Declare once to avoid the warning from the Unity shader compiler.
uint i; // Declare once to avoid the warning from the Unity shader compiler.
for (i = 1, n = SSS_N_SAMPLES_FAR_FIELD; i < n; i++)
for (i = 1; i < SSS_N_SAMPLES_FAR_FIELD; i++)
{
// Integrate over the image or tangent plane in the view space.
EvaluateSample(i, n, profileID, iR, iP, pixelCoord + 0.5, cacheOffset,

}
[unroll]
for (i = SSS_N_SAMPLES_FAR_FIELD, n = SSS_N_SAMPLES_NEAR_FIELD; i < n; i++)
for (i = SSS_N_SAMPLES_FAR_FIELD; i < SSS_N_SAMPLES_NEAR_FIELD; i++)
{
// Integrate over the image or tangent plane in the view space.
EvaluateSample(i, n, profileID, iR, iP, pixelCoord + 0.5, cacheOffset,

正在加载...
取消
保存