浏览代码

Merge pull request #1216 from Unity-Technologies/lw/fixes

Lw/fixes
/main
GitHub 7 年前
当前提交
0c2357e7
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 11
      ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs

11
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs


depthRTDesc.colorFormat = RenderTextureFormat.Depth;
depthRTDesc.depthBufferBits = kDepthStencilBufferBits;
cmd.GetTemporaryRT(CameraRenderTargetID.depth, depthRTDesc, FilterMode.Bilinear);
cmd.GetTemporaryRT(CameraRenderTargetID.depth, depthRTDesc, FilterMode.Point);
cmd.GetTemporaryRT(CameraRenderTargetID.depthCopy, depthRTDesc, FilterMode.Bilinear);
cmd.GetTemporaryRT(CameraRenderTargetID.depthCopy, depthRTDesc, FilterMode.Point);
m_ShadowPass.InitializeResources(cmd, baseDesc);
}

{
VisibleLight light = visibleLights[i];
if (light.lightType == LightType.Directional)
{
++directionalLightCount;
}
else
perObjectLightIndexMap[i] -= directionalLightCount;
}

// Main light has an optimized shader path for main light. This will benefit games that only care about a single light.
// Lightweight pipeline also supports only a single shadow light, if available it will be the main light.
SetupMainLightConstants(cmd, ref lightData);
SetupAdditionalListConstants(cmd, ref lightData);
SetupAdditionalLightConstants(cmd, ref lightData);
}
private void SetupMainLightConstants(CommandBuffer cmd, ref LightData lightData)

cmd.SetGlobalVector(PerCameraBuffer._MainLightColor, lightColor);
}
private void SetupAdditionalListConstants(CommandBuffer cmd, ref LightData lightData)
private void SetupAdditionalLightConstants(CommandBuffer cmd, ref LightData lightData)
{
List<VisibleLight> lights = lightData.visibleLights;
if (lightData.totalAdditionalLightsCount > 0)

正在加载...
取消
保存