浏览代码

HDRP: Provide more precision for spot light with narrow angle

/main
sebastienlagarde 6 年前
当前提交
c2954814
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 2
      com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoop.cs

2
com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoop.cs


var sinSpotOuterHalfAngle = Mathf.Sqrt(1.0f - cosSpotOuterHalfAngle * cosSpotOuterHalfAngle);
var cosSpotInnerHalfAngle = Mathf.Clamp(Mathf.Cos(spotAngle * 0.5f * innerConePercent * Mathf.Deg2Rad), 0.0f, 1.0f); // inner cone
var val = Mathf.Max(0.001f, (cosSpotInnerHalfAngle - cosSpotOuterHalfAngle));
var val = Mathf.Max(0.0001f, (cosSpotInnerHalfAngle - cosSpotOuterHalfAngle));
lightData.angleScale = 1.0f / val;
lightData.angleOffset = -cosSpotOuterHalfAngle * lightData.angleScale;

正在加载...
取消
保存