浏览代码

Fixed vertex light computation and amount o max local pixels per pass.

/main
Felipe Lira 7 年前
当前提交
c62af604
共有 1 个文件被更改,包括 8 次插入3 次删除
  1. 11
      ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs

11
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs


private void InitializeLightData(List<VisibleLight> visibleLights, out LightData lightData)
{
m_LocalLightIndices.Clear();
for (int i = 0; i < visibleLights.Count && i < m_MaxLocalLightsShadedPerPass; ++i)
for (int i = 0; i < visibleLights.Count; ++i)
{
if (m_LocalLightIndices.Count >= m_MaxLocalLightsShadedPerPass)
break;
}
// Clear to default all light constant data
for (int i = 0; i < kMaxVisibleLocalLights; ++i)

// If we have a main light we don't shade it in the per-object light loop. We also remove it from the per-object cull list
int mainLightPresent = (lightData.mainLightIndex >= 0) ? 1 : 0;
int additionalPixelLightsCount = visibleLightsCount - mainLightPresent;
int vertexLightCount = (m_Asset.SupportsVertexLight) ? Math.Min(visibleLights.Count, m_MaxLocalLightsShadedPerPass) - additionalPixelLightsCount - mainLightPresent : 0;
int additionalPixelLightsCount = Math.Min(visibleLightsCount - mainLightPresent, m_MaxLocalLightsShadedPerPass);
int vertexLightCount = (m_Asset.SupportsVertexLight) ? Math.Min(visibleLights.Count, m_MaxLocalLightsShadedPerPass) - additionalPixelLightsCount : 0;
vertexLightCount = Math.Min(vertexLightCount, kMaxVertexLights);
lightData.pixelAdditionalLightsCount = additionalPixelLightsCount;

正在加载...
取消
保存