浏览代码

Remove `continue`

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

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


millimPerUnit, scaledPixPerMm, rcpDistScale, totalIrradiance, totalWeight) \
{ \
float r = kernel[profileID][i][0]; \
/* The relative sample position is known at the compile time. */ \
/* The relative sample position is known at compile time. */ \
float phi = TWO_PI * Fibonacci2d(i, n).y; \
float2 vec = r * float2(cos(phi), sin(phi)); \
\

float3 irradiance = LOAD_TEXTURE2D(_IrradianceSource, position).rgb; \
\
[flatten] \
if (any(irradiance) == false) \
if (any(irradiance)) \
{ \
/* Apply bilateral weighting. */ \
float d = LinearEyeDepth(depth, _ZBufferParams); \
float z = millimPerUnit * d - (millimPerUnit * centerDepthVS); \
float3 w = ComputeBilateralWeight(shapeParam, r, z, rcpDistScale, rcpPdf); \
\
totalIrradiance += w * irradiance; \
totalWeight += w; \
} \
else \
{ \
/*************************************************************************/ \
/* The irradiance is 0. This could happen for 3 reasons. */ \

/* 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). */ \
/*************************************************************************/ \
continue; \
\
/* Apply bilateral weighting. */ \
float d = LinearEyeDepth(depth, _ZBufferParams); \
float z = millimPerUnit * d - (millimPerUnit * centerDepthVS); \
float3 w = ComputeBilateralWeight(shapeParam, r, z, rcpDistScale, rcpPdf); \
\
totalIrradiance += w * irradiance; \
totalWeight += w; \
}
struct Attributes

正在加载...
取消
保存