浏览代码

Add a small LTC line light optimization

/main
Evgenii Golubev 8 年前
当前提交
70e2eef6
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 7
      Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Lit.hlsl

7
Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Lit.hlsl


basis[1] = normalize(cross(bsdfData.normalWS, basis[0]));
basis[2] = bsdfData.normalWS;
// Rotate both endpoints and the tangent into the local coordinate system (left-handed).
// Rotate both endpoints into the local coordinate system (left-handed).
T = mul(T, transpose(basis));
// Terminate the algorithm if both points are below the horizon.
if (P1.z <= 0.0 && P2.z <= 0.0) return;

// Convention: 'P2' is above the horizon.
swap(P1, P2);
T = -T;
// Recompute the tangent in the local coordinate system.
T = normalize(P2 - P1);
// Clip the part of the light below the horizon.
if (P1.z <= 0.0)

正在加载...
取消
保存