您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
57 行
1.4 KiB
57 行
1.4 KiB
using UnityEngine.Rendering;
|
|
using System;
|
|
|
|
namespace UnityEngine.Experimental.Rendering.HDPipeline
|
|
{
|
|
internal class SkyUpdateContext
|
|
{
|
|
|
|
SkySettings m_SkySettings;
|
|
SkyRenderer m_Renderer;
|
|
|
|
public int skyParametersHash = -1;
|
|
public float currentUpdateTime = 0.0f;
|
|
public int updatedFramesRequired = 1; // The first frame after the scene load is currently not rendered correctly
|
|
|
|
public SkySettings skySettings
|
|
{
|
|
get { return m_SkySettings; }
|
|
set
|
|
{
|
|
if (m_SkySettings == value)
|
|
return;
|
|
|
|
if (m_Renderer != null)
|
|
{
|
|
m_Renderer.Cleanup();
|
|
m_Renderer = null;
|
|
}
|
|
|
|
skyParametersHash = -1;
|
|
m_SkySettings = value;
|
|
updatedFramesRequired = 1;
|
|
currentUpdateTime = 0.0f;
|
|
|
|
if (value != null)
|
|
{
|
|
m_Renderer = value.CreateRenderer();
|
|
m_Renderer.Build();
|
|
}
|
|
}
|
|
}
|
|
|
|
public SkyRenderer renderer { get { return m_Renderer; } }
|
|
|
|
public bool IsValid()
|
|
{
|
|
return m_Renderer != null && m_Renderer.IsValid();
|
|
}
|
|
|
|
public void Cleanup()
|
|
{
|
|
if (m_Renderer != null)
|
|
m_Renderer.Cleanup();
|
|
}
|
|
|
|
}
|
|
}
|