浏览代码

Optimize branches a bit

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

12
Assets/ScriptableRenderPipeline/ShaderLibrary/AreaLighting.hlsl


float omega = acos(cosOmega);
float gamma = asin(sinGamma);
[branch]
if (omega < 0 || omega >= HALF_PI + sigma)
{
// Full horizon occlusion (case #4).
return 0;
}
// if (omega < 0 || omega >= HALF_PI + sigma)
// {
// // Full horizon occlusion (case #4). It should be handled outside of this function.
// return 0;
// }
float e = sinSqSigma * cosOmega;

#else // Ref: Moving Frostbite to Physically Based Rendering, page 47 (2015).
float irradiance;
[branch]
if (cosOmega * cosOmega > sinSqSigma)
{
irradiance = sinSqSigma * saturate(cosOmega);

正在加载...
取消
保存