浏览代码

Merge pull request #723 from Unity-Technologies/Branch_SkyLightingOverride

Tentative fix for additive scene loading breaking the "bake sky"
/feature-ReflectionProbeFit
GitHub 7 年前
当前提交
623fd386
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/SkyManager.cs

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/SkyManager.cs


cmd.SetGlobalTexture(HDShaderIDs._SkyTexture, CoreUtils.magentaCubeTexture);
// This is done here because we need to wait for one frame that the command buffer is executed before using the resulting textures.
if (m_NeedUpdateBakingSky)
// Testing the current skybox material is because we have to make sure that additive scene loading or even some user script haven't altered it.
if (m_NeedUpdateBakingSky || (RenderSettings.skybox != m_StandardSkyboxMaterial))
{
// Here we update the global SkyMaterial so that it uses our baking sky cubemap. This way, next time the GI is baked, the right sky will be present.
float intensity = m_BakingSky.IsValid() ? 1.0f : 0.0f; // Eliminate all diffuse if we don't have a skybox (meaning for now the background is black in HDRP)

正在加载...
取消
保存