浏览代码

Merge pull request #976 from Unity-Technologies/Fix-sky-issue

Fix sky issue
/main
GitHub 7 年前
当前提交
af64eeb2
共有 3 个文件被更改,包括 12 次插入11 次删除
  1. 4
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/Lit/LitUI.cs
  2. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs
  3. 17
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/SkyManager.cs

4
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/Lit/LitUI.cs


protected void ShaderSSSAndTransmissionInputGUI(Material material, int layerIndex)
{
var hdPipeline = RenderPipelineManager.currentPipeline as HDRenderPipeline;
if (hdPipeline == null)
return;
var diffusionProfileSettings = hdPipeline.diffusionProfileSettings;
if (hdPipeline.IsInternalDiffusionProfile(diffusionProfileSettings))

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs


Resize(hdCamera);
m_SkyManager.UpdateCurrentSkySettings(hdCamera);
// TODO: Float HDCamera setup higher in order to pass stereo into GetCullingParameters
ScriptableCullingParameters cullingParams;

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


var visualEnv = stack.GetComponent<VisualEnvironment>();
int skyID = visualEnv.skyType;
Type skyType;
if(m_SkyTypesDict.TryGetValue(skyID, out skyType))
if (skyTypesDict.TryGetValue(skyID, out skyType))
{
return (SkySettings)stack.GetComponent(skyType);
}

static void UpdateSkyTypes()
{
if(m_SkyTypesDict == null)
if (m_SkyTypesDict == null)
foreach(Type skyType in skyTypes)
foreach (Type skyType in skyTypes)
if(uniqueIDs.Length == 0)
if (uniqueIDs.Length == 0)
{
Debug.LogWarningFormat("Missing attribute SkyUniqueID on class {0}. Class won't be registered as an available sky.", skyType);
}

if(uniqueID == 0)
if (uniqueID == 0)
{
Debug.LogWarningFormat("0 is a reserved SkyUniqueID and is used in class {0}. Class won't be registered as an available sky.", skyType);
continue;

if(m_SkyTypesDict.TryGetValue(uniqueID, out value))
if (m_SkyTypesDict.TryGetValue(uniqueID, out value))
{
Debug.LogWarningFormat("SkyUniqueID {0} used in class {1} is already used in class {2}. Class won't be registered as an available sky.", uniqueID, skyType, value);
continue;

}
}
void UpdateCurrentSkySettings(HDCamera camera)
public void UpdateCurrentSkySettings(HDCamera camera)
{
m_VisualSky.skySettings = GetSkySetting(VolumeManager.instance.stack);

//DynamicGI.SetEnvironmentData();
m_NeedUpdateRealtimeEnv = false;
}
UpdateSkyTypes();
UpdateCurrentSkySettings(camera);
// For the baking sky, we don't want to take the sun into account because we usually won't include it (this would cause double highlight in the reflection for example).
// So we pass null so that's it doesn't affect the hash and the rendering.

正在加载...
取消
保存