浏览代码

Allow the compiler to pull the load outside of the loop

/main
Evgenii Golubev 7 年前
当前提交
3c38c6a1
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 10
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl

10
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl


// we need to push the shading position back to avoid self-shadowing problems.
float3 ComputeThicknessDisplacement(BSDFData bsdfData, float3 L, float NdotL)
{
// Compute the thickness in world units along the normal.
float thicknessInMeters = bsdfData.thickness * METERS_PER_MILLIMETER;
float thicknessInUnits = thicknessInMeters * _WorldScales[bsdfData.diffusionProfile].y;
[flatten] if (bsdfData.useThickObjectMode && NdotL < 0)
if (bsdfData.useThickObjectMode && NdotL < 0)
// Compute the thickness in world units along the normal.
float thicknessInMeters = bsdfData.thickness * METERS_PER_MILLIMETER;
float thicknessInUnits = thicknessInMeters * _WorldScales[bsdfData.diffusionProfile].y;
// Compute the thickness in world units along the light vector.
displacement = thicknessInUnits / -NdotL;
}

正在加载...
取消
保存