@@ -104,7 +104,7 @@ internal static Volume GetOrCreateDefaultVolume()
104104 readonly XRSystem m_XRSystem ;
105105
106106 bool m_FrameSettingsHistoryEnabled = false ;
107- bool m_DisableCookieForLightBaking = false ;
107+ bool m_PreviousDisableCookieForLightBaking = false ;
108108
109109 /// <summary>
110110 /// This functions allows the user to have an approximation of the number of rays that were traced for a given frame.
@@ -664,9 +664,6 @@ void SetRenderingFeatures()
664664 GraphicsSettings . lightsUseLinearIntensity = true ;
665665 GraphicsSettings . lightsUseColorTemperature = true ;
666666
667- m_DisableCookieForLightBaking = UnityEditor . EditorSettings . disableCookiesInLightmapper ;
668- UnityEditor . EditorSettings . disableCookiesInLightmapper = false ;
669-
670667 GraphicsSettings . useScriptableRenderPipelineBatching = m_Asset . enableSRPBatcher ;
671668
672669 SupportedRenderingFeatures . active = new SupportedRenderingFeatures ( )
@@ -694,6 +691,10 @@ void SetRenderingFeatures()
694691 Lightmapping . SetDelegate ( GlobalIlluminationUtils . hdLightsDelegate ) ;
695692
696693#if UNITY_EDITOR
694+ // HDRP always enable baking of cookie by default
695+ m_PreviousDisableCookieForLightBaking = UnityEditor . EditorSettings . disableCookiesInLightmapper ;
696+ UnityEditor . EditorSettings . disableCookiesInLightmapper = false ;
697+
697698 SceneViewDrawMode . SetupDrawMode ( ) ;
698699
699700 if ( UnityEditor . PlayerSettings . colorSpace == ColorSpace . Gamma )
@@ -783,9 +784,11 @@ void UnsetRenderingFeatures()
783784 // Reset srp batcher state just in case
784785 GraphicsSettings . useScriptableRenderPipelineBatching = false ;
785786
786- UnityEditor . EditorSettings . disableCookiesInLightmapper = m_DisableCookieForLightBaking ;
787-
788787 Lightmapping . ResetDelegate ( ) ;
788+
789+ #if UNITY_EDITOR
790+ UnityEditor . EditorSettings . disableCookiesInLightmapper = m_PreviousDisableCookieForLightBaking ;
791+ #endif
789792 }
790793
791794 void InitializeDebugMaterials ( )
0 commit comments