@@ -103,7 +103,7 @@ internal static Volume GetOrCreateDefaultVolume()
103103 readonly XRSystem m_XRSystem ;
104104
105105 bool m_FrameSettingsHistoryEnabled = false ;
106- bool m_DisableCookieForLightBaking = false ;
106+ bool m_PreviousDisableCookieForLightBaking = false ;
107107
108108 /// <summary>
109109 /// This functions allows the user to have an approximation of the number of rays that were traced for a given frame.
@@ -672,9 +672,6 @@ void SetRenderingFeatures()
672672 GraphicsSettings . lightsUseLinearIntensity = true ;
673673 GraphicsSettings . lightsUseColorTemperature = true ;
674674
675- m_DisableCookieForLightBaking = UnityEditor . EditorSettings . disableCookiesInLightmapper ;
676- UnityEditor . EditorSettings . disableCookiesInLightmapper = false ;
677-
678675 GraphicsSettings . useScriptableRenderPipelineBatching = m_Asset . enableSRPBatcher ;
679676
680677 SupportedRenderingFeatures . active = new SupportedRenderingFeatures ( )
@@ -702,6 +699,10 @@ void SetRenderingFeatures()
702699 Lightmapping . SetDelegate ( GlobalIlluminationUtils . hdLightsDelegate ) ;
703700
704701#if UNITY_EDITOR
702+ // HDRP always enable baking of cookie by default
703+ m_PreviousDisableCookieForLightBaking = UnityEditor . EditorSettings . disableCookiesInLightmapper ;
704+ UnityEditor . EditorSettings . disableCookiesInLightmapper = false ;
705+
705706 SceneViewDrawMode . SetupDrawMode ( ) ;
706707
707708 if ( UnityEditor . PlayerSettings . colorSpace == ColorSpace . Gamma )
@@ -791,9 +792,11 @@ void UnsetRenderingFeatures()
791792 // Reset srp batcher state just in case
792793 GraphicsSettings . useScriptableRenderPipelineBatching = false ;
793794
794- UnityEditor . EditorSettings . disableCookiesInLightmapper = m_DisableCookieForLightBaking ;
795-
796795 Lightmapping . ResetDelegate ( ) ;
796+
797+ #if UNITY_EDITOR
798+ UnityEditor . EditorSettings . disableCookiesInLightmapper = m_PreviousDisableCookieForLightBaking ;
799+ #endif
797800 }
798801
799802 void InitializeDebugMaterials ( )
0 commit comments