浏览代码

Enable the sphere light approximation

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

9
Assets/ScriptableRenderPipeline/ShaderLibrary/AreaLighting.hlsl


#ifndef UNITY_AREA_LIGHTING_INCLUDED
#define UNITY_AREA_LIGHTING_INCLUDED
// #define SPHERE_APPROX
#define SPHERE_LIGHT_APPROXIMATION
// Not normalized by the factor of 1/TWO_PI.
float3 ComputeEdgeFactor(float3 V1, float3 V2)

float cosSqSigma = saturate(1 - sinSqSigma);
float sinSqGamma = saturate(cosSqSigma / sinSqOmega);
float cosSqGamma = saturate(1 - sinSqGamma);
float sinSigma = sqrt(sinSqSigma);
float sinGamma = sqrt(sinSqGamma);
float cosGamma = sqrt(cosSqGamma);
float sinSigma = sqrt(sinSqSigma);
float sinGamma = sqrt(sinSqGamma);
float cosGamma = sqrt(cosSqGamma);
float sigma = asin(sinSigma);
float omega = acos(cosOmega);

正在加载...
取消
保存