浏览代码

Save 1x VALU

/Yibing-Project-2
GitHub 7 年前
当前提交
f87b3274
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 8
      ScriptableRenderPipeline/Core/ShaderLibrary/GeometricTools.hlsl

8
ScriptableRenderPipeline/Core/ShaderLibrary/GeometricTools.hlsl


float3 pExit = o + tExit * d;
// Clip the negative cone.
if (max(pEntr.z, pExit.z) < 0) { hit = false; }
if (pEntr.z < 0) { tEntr = tExit; tExit = tMax; }
if (pExit.z < 0) { tExit = tEntr; tEntr = tMin; }
bool pEntrNeg = pEntr.z < 0;
bool pExitNeg = pExit.z < 0;
if (pEntrNeg && pExitNeg) { hit = false; }
if (pEntrNeg) { tEntr = tExit; tExit = tMax; }
if (pExitNeg) { tExit = tEntr; tEntr = tMin; }
// Clamp using the values passed into the function.
tEntr = clamp(tEntr, tMin, tMax);

正在加载...
取消
保存