浏览代码

Simplify further

/Branch_Batching2
Evgenii Golubev 8 年前
当前提交
97db196f
共有 1 个文件被更改,包括 9 次插入5 次删除
  1. 14
      Assets/ScriptableRenderPipeline/ShaderLibrary/AreaLighting.hlsl

14
Assets/ScriptableRenderPipeline/ShaderLibrary/AreaLighting.hlsl


}
else
{
float cotanOmega = cosOmega * rsqrt(1 - cosSqOmega);
float cotSqSigma = rcp(sinSqSigma) - 1;
float tanSqSigma = rcp(cotSqSigma);
float sinSqOmega = 1 - cosSqOmega;
float x = rcp(sinSqSigma) - 1;
float y = -cotanOmega * sqrt(x);
float z = sqrt(1 - cosSqOmega * rcp(sinSqSigma));
float x = sinSqOmega * tanSqSigma;
float y = -cosOmega * rsqrt(x);
irradiance = INV_PI * ((cosOmega * acos(y) - z * sqrt(x)) * sinSqSigma + atan(z * rsqrt(x)));
float b = sqrt(sinSqOmega * tanSqSigma - cosSqOmega);
float a = b * cotSqSigma;
irradiance = INV_PI * ((cosOmega * acos(y) - a) * sinSqSigma + atan(b));
}
#endif
return max(irradiance, 0);

正在加载...
取消
保存