浏览代码

Replace the reciprocal with the division for readability

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

4
Assets/ScriptableRenderLoop/ShaderLibrary/AreaLighting.hlsl


float d = length(normal);
float l1rcpD = l1 * rcp(d);
float l2rcpD = l2 * rcp(d);
float tLDDL1 = l1rcpD * rcp(sq(d) + sq(l1));
float tLDDL2 = l2rcpD * rcp(sq(d) + sq(l2));
float tLDDL1 = l1rcpD / (sq(d) + sq(l1));
float tLDDL2 = l2rcpD / (sq(d) + sq(l2));
float intWt = LineFwt(tLDDL2, l2) - LineFwt(tLDDL1, l1);
float intP0 = LineFpo(tLDDL2, l2rcpD, rcp(d)) - LineFpo(tLDDL1, l1rcpD, rcp(d));
return intP0 * normal.z + intWt * tangent.z;

正在加载...
取消
保存