浏览代码

Add proper detection for mobile platform

/main
egomeh 6 年前
当前提交
e639728a
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 5
      com.unity.render-pipelines.lightweight/LWRP/Passes/SetupLightweightConstanstPass.cs

5
com.unity.render-pipelines.lightweight/LWRP/Passes/SetupLightweightConstanstPass.cs


float oneOverFadeRangeSqr = 1.0f / fadeRangeSqr;
float lightRangeSqrOverFadeRangeSqr = -lightRangeSqr / fadeRangeSqr;
float oneOverLightRangeSqr = 1.0f / Mathf.Max(0.0001f, lightData.range * lightData.range);
lightAttenuation.x = SystemInfo.deviceType == DeviceType.Handheld ? oneOverFadeRangeSqr : oneOverLightRangeSqr;
// On mobile: Use the faster linear smoothing factor.
// On other devices: Use the smoothing factor that matches the GI.
lightAttenuation.x = Application.isMobilePlatform ? oneOverFadeRangeSqr : oneOverLightRangeSqr;
lightAttenuation.y = lightRangeSqrOverFadeRangeSqr;
subtractiveMixedLighting = 1.0f;
}

正在加载...
取消
保存