浏览代码

Add support of Preview sky

/main
sebastienlagarde 7 年前
当前提交
df5a7472
共有 1 个文件被更改,包括 17 次插入0 次删除
  1. 17
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/SkyManager.cs

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


bool m_NeedUpdateRealtimeEnv = false;
bool m_NeedUpdateBakingSky = true;
#if UNITY_EDITOR
// For Preview windows we want to have a 'fixed' sky, so we can display chrome metal and have always the same look
ProceduralSky m_DefaultPreviewSky;
#endif
// This is the sky used for rendering in the main view. It will also be used for lighting if no lighting override sky is setup.
// Ambient Probe: Only for real time GI (otherwise we use the baked one)
// Reflection Probe : Always used and updated depending on the OnChanged/Realtime flags.

void UpdateCurrentSkySettings(HDCamera camera)
{
m_VisualSky.skySettings = GetSkySetting(VolumeManager.instance.stack);
#if UNITY_EDITOR
if (camera.camera.cameraType == CameraType.Preview)
{
m_VisualSky.skySettings = m_DefaultPreviewSky;
}
#endif
m_BakingSky.skySettings = SkyManager.GetBakingSkySettings();
// Update needs to happen before testing if the component is active other internal data structure are not properly updated yet.

m_LightingOverrideVolumeStack = VolumeManager.instance.CreateStack();
m_LightingOverrideLayerMask = hdAsset.renderPipelineSettings.lightLoopSettings.skyLightingOverrideLayerMask;
#if UNITY_EDITOR
m_DefaultPreviewSky = ScriptableObject.CreateInstance<ProceduralSky>();
#endif
}
public void Cleanup()

正在加载...
取消
保存