|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
if (camera.camera.cameraType == CameraType.Preview) |
|
|
|
{ |
|
|
|
m_VisualSky.skySettings = m_DefaultPreviewSky; |
|
|
|
m_VisualSky.skySettings = GetDefaultPreviewSkyInstance(); |
|
|
|
} |
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
cmd.SetGlobalFloat(HDShaderIDs._SkyTextureMipCount, mipCount); |
|
|
|
} |
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
ProceduralSky GetDefaultPreviewSkyInstance() |
|
|
|
{ |
|
|
|
if (m_DefaultPreviewSky == null) |
|
|
|
{ |
|
|
|
m_DefaultPreviewSky = ScriptableObject.CreateInstance<ProceduralSky>(); |
|
|
|
} |
|
|
|
|
|
|
|
return m_DefaultPreviewSky; |
|
|
|
} |
|
|
|
#endif
|
|
|
|
|
|
|
|
public void Build(HDRenderPipelineAsset hdAsset, IBLFilterGGX iblFilterGGX) |
|
|
|
{ |
|
|
|
m_BakingSkyRenderingContext = new SkyRenderingContext(iblFilterGGX, (int)hdAsset.renderPipelineSettings.lightLoopSettings.skyReflectionSize, false); |
|
|
|
|
|
|
|
|
|
|
m_LightingOverrideVolumeStack = VolumeManager.instance.CreateStack(); |
|
|
|
m_LightingOverrideLayerMask = hdAsset.renderPipelineSettings.lightLoopSettings.skyLightingOverrideLayerMask; |
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
m_DefaultPreviewSky = ScriptableObject.CreateInstance<ProceduralSky>(); |
|
|
|
#endif
|
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
CoreUtils.Destroy(m_DefaultPreviewSky); |
|
|
|
#endif
|
|
|
|
CoreUtils.Destroy(m_StandardSkyboxMaterial); |
|
|
|
CoreUtils.Destroy(m_BlitCubemapMaterial); |
|
|
|
CoreUtils.Destroy(m_OpaqueAtmScatteringMaterial); |
|
|
|