浏览代码

Remove the function sq()

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

6
Assets/ScriptableRenderLoop/ShaderLibrary/AreaLighting.hlsl


float LineFpo(float tLDDL, float lrcpD, float rcpD)
{
// Compute: ((l / d) / (d * d + l * l)) + (1.0 / (d * d)) * atan(l / d).
return tLDDL + sq(rcpD) * atan(lrcpD);
return tLDDL + rcpD * rcpD * atan(lrcpD);
}
float LineFwt(float tLDDL, float l)

float d = length(normal);
float l1rcpD = l1 * rcp(d);
float l2rcpD = l2 * rcp(d);
float tLDDL1 = l1rcpD / (sq(d) + sq(l1));
float tLDDL2 = l2rcpD / (sq(d) + sq(l2));
float tLDDL1 = l1rcpD / (d * d + l1 * l1);
float tLDDL2 = l2rcpD / (d * d + l2 * 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;

5
Assets/ScriptableRenderLoop/ShaderLibrary/Common.hlsl


}
#endif // INTRINSIC_MINMAX3
float sq(float x)
{
return x * x;
}
void swap(inout float a, inout float b)
{
float t = a; a = b; b = t;

正在加载...
取消
保存