浏览代码

Added light index map to disable exceeding lights uploaded to buffer.

/RenderPassXR_Sandbox
Felipe Lira 7 年前
当前提交
cecb2f6f
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7
      Assets/ScriptableRenderPipeline/LightweightPipeline/LightweightPipeline.cs

7
Assets/ScriptableRenderPipeline/LightweightPipeline/LightweightPipeline.cs


}
}
// Lightweight pipeline only upload kMaxVisibleLights to shader cbuffer.
// We tell the pipe to disable remaining lights by setting it to -1.
int[] lightIndexMap = m_CullResults.GetLightIndexMap();
for (int i = kMaxVisibleLights; i < lightIndexMap.Length; ++i)
lightIndexMap[i] = -1;
m_CullResults.SetLightIndexMap(lightIndexMap);
CommandBuffer cmd = CommandBufferPool.Get("SetupShadowShaderConstants");
cmd.SetGlobalVector("globalLightCount", new Vector4 (lightData.pixelLightsCount, lightData.vertexLightsCount, 0.0f, 0.0f));
cmd.SetGlobalVectorArray ("globalLightPos", m_LightPositions);

正在加载...
取消
保存