Skip to content

Commit

Permalink
Fix compil issue with Enable BakeCookie
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienlagarde committed Apr 17, 2020
1 parent 6118301 commit 6cdf38e
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ internal static Volume GetOrCreateDefaultVolume()
readonly XRSystem m_XRSystem;

bool m_FrameSettingsHistoryEnabled = false;
bool m_DisableCookieForLightBaking = false;
bool m_PreviousDisableCookieForLightBaking = false;

/// <summary>
/// This functions allows the user to have an approximation of the number of rays that were traced for a given frame.
Expand Down Expand Up @@ -672,9 +672,6 @@ void SetRenderingFeatures()
GraphicsSettings.lightsUseLinearIntensity = true;
GraphicsSettings.lightsUseColorTemperature = true;

m_DisableCookieForLightBaking = UnityEditor.EditorSettings.disableCookiesInLightmapper;
UnityEditor.EditorSettings.disableCookiesInLightmapper = false;

GraphicsSettings.useScriptableRenderPipelineBatching = m_Asset.enableSRPBatcher;

SupportedRenderingFeatures.active = new SupportedRenderingFeatures()
Expand Down Expand Up @@ -702,6 +699,10 @@ void SetRenderingFeatures()
Lightmapping.SetDelegate(GlobalIlluminationUtils.hdLightsDelegate);

#if UNITY_EDITOR
// HDRP always enable baking of cookie by default
m_PreviousDisableCookieForLightBaking = UnityEditor.EditorSettings.disableCookiesInLightmapper;
UnityEditor.EditorSettings.disableCookiesInLightmapper = false;

SceneViewDrawMode.SetupDrawMode();

if (UnityEditor.PlayerSettings.colorSpace == ColorSpace.Gamma)
Expand Down Expand Up @@ -791,9 +792,11 @@ void UnsetRenderingFeatures()
// Reset srp batcher state just in case
GraphicsSettings.useScriptableRenderPipelineBatching = false;

UnityEditor.EditorSettings.disableCookiesInLightmapper = m_DisableCookieForLightBaking;

Lightmapping.ResetDelegate();

#if UNITY_EDITOR
UnityEditor.EditorSettings.disableCookiesInLightmapper = m_PreviousDisableCookieForLightBaking;
#endif
}

void InitializeDebugMaterials()
Expand Down

0 comments on commit 6cdf38e

Please sign in to comment.