浏览代码

Clamp instead of add

/feature-ReflectionProbeFit
Evgenii Golubev 7 年前
当前提交
c73e4f1a
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 2
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Packing.hlsl

2
ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Packing.hlsl


// Solve for {x, y, z} given {r, g}.
real x = 0.5 * g + 0.5 - s * r;
real y = g - x;
real z = s * (saturate(1.0 - abs(x) - abs(y)) + FLT_EPS); // saturate() and EPS are absolutely crucial for numerical stability
real z = s * max(FLT_EPS, 1.0 - abs(x) - abs(y)); // Clamping is absolutely crucial for numerical stability
real3 p = real3(x, y, z);

正在加载...
取消
保存