浏览代码

Implement small trig optimizations

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

9
Assets/ScriptableRenderPipeline/ShaderLibrary/AreaLighting.hlsl


F += INV_TWO_PI * ComputeEdgeFactor(V1, V2);
}
float f = length(F);
float sinSqSigma = f;
float f2 = dot(F, F);
float sinSqSigma = sqrt(f2);
float cosOmega = F.z / f;
float cosSigma = sqrt(1 - sinSigma * sinSigma);
float cosOmega = F.z * rsqrt(f2);
float cosSigma = sqrt(1 - sinSqSigma);
float sinOmega = sqrt(1 - cosOmega * cosOmega);
float sinGamma = cosSigma / sinOmega;
float cosSqGamma = 1 - sinGamma * sinGamma;

正在加载...
取消
保存