浏览代码

Make the LTC line algorithm numerically safe

/main
Evgenii Golubev 8 年前
当前提交
8ba9f706
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 3
      Assets/ScriptableRenderLoop/ShaderLibrary/AreaLighting.hlsl

3
Assets/ScriptableRenderLoop/ShaderLibrary/AreaLighting.hlsl


// Compute the width factor. We take the absolute value because the points may be swapped.
float width = abs(dot(B, normalize(cross(T, P1))));
return INV_PI * width * irradiance;
// Guard against numerical precision issues.
return max(INV_PI * width * irradiance, 0.0);
}
#endif // UNITY_AREA_LIGHTING_INCLUDED
正在加载...
取消
保存