浏览代码

Fix the Mathematica code

/Branch_Batching2
Evgenii Golubev 8 年前
当前提交
3b0e865d
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 12
      Assets/ScriptableRenderPipeline/ShaderLibrary/AreaLighting.hlsl

12
Assets/ScriptableRenderPipeline/ShaderLibrary/AreaLighting.hlsl


else
{
float cotSqSigma = rcp(sinSqSigma) - 1; // 1/x-1
float tanSqSigma = rcp(cotSqSigma); // (1-x)/x
float tanSqSigma = rcp(cotSqSigma); // x/(1-x)
float w = sinSqOmega * tanSqSigma; // (1-y^2)*((1-x)/x)
float w = sinSqOmega * tanSqSigma; // (1-y^2)*(x/(1-x))
float y = sqrt(sinSqOmega * tanSqSigma - cosSqOmega); // Sqrt[(1-y^2)*((1-x)/x)-y^2]
float z = y * cotSqSigma; // Sqrt[(1-y^2)*((1-x)/x)-y^2]*(1/x-1)
float y = sqrt(sinSqOmega * tanSqSigma - cosSqOmega); // Sqrt[(1-y^2)*(x/(1-x))-y^2]
float z = y * cotSqSigma; // Sqrt[(1-y^2)*(x/(1-x))-y^2]*(1/x-1)
float a = cosOmega * acos(x) - z; // y*ArcCos[-y*Sqrt[(1/x-1)/(1-y^2)]]-Sqrt[(1-y^2)*((1-x)/x)-y^2]*(1/x-1)
float b = atan(y); // ArcTan[Sqrt[(1-y^2)*((1-x)/x)-y^2]]
float a = cosOmega * acos(x) - z; // y*ArcCos[-y*Sqrt[(1/x-1)/(1-y^2)]]-Sqrt[(1-y^2)*(x/(1-x))-y^2]*(1/x-1)
float b = atan(y); // ArcTan[Sqrt[(1-y^2)*(x/(1-x))-y^2]]
// Replacing max() with saturate() results in a 12 cycle SGPR forwarding stall on PS4.
return max(INV_PI * (a * sinSqSigma + b), 0); // (a/Pi)*x+(b/Pi)

正在加载...
取消
保存