浏览代码

Merge pull request #1036 from Unity-Technologies/Branch_FixMaxShadowDistanceFade

Fixed shadow fade out of punctual lights with max shadow distance.
/2018.1
GitHub 7 年前
当前提交
65f445a4
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 6
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.cs

6
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.cs


m_CurrentSunLightShadowIndex = shadowIdx;
}
// TODO: Currently m_maxShadowDistance is based on shadow settings, but this value is define for a whole level. We should be able to change this value during gameplay
float scale;
float bias;
GetScaleAndBiasForLinearDistanceFade(m_maxShadowDistance, out scale, out bias);

if (additionalshadowData)
{
float shadowDistanceFade = ComputeLinearDistanceFade(distanceToCamera, additionalshadowData.shadowFadeDistance);
float shadowDistanceFade = ComputeLinearDistanceFade(distanceToCamera, Mathf.Min(shadowSettings.maxShadowDistance, additionalshadowData.shadowFadeDistance));
lightData.shadowDimmer = additionalshadowData.shadowDimmer * shadowDistanceFade;
}
else

{
// If any light require it, we need to enabled bake shadow mask feature
m_enableBakeShadowMask = false;
m_maxShadowDistance = shadowSettings.maxShadowDistance;
m_lightList.Clear();

}
UpdateDataBuffers();
m_maxShadowDistance = shadowSettings.maxShadowDistance;
return m_enableBakeShadowMask;
}

正在加载...
取消
保存