浏览代码

Fixed empty editor debug window on srp asset reload

/main
Thomas 6 年前
当前提交
7fc1f0a9
共有 4 个文件被更改,包括 17 次插入19 次删除
  1. 12
      ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugManager.cs
  2. 18
      ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugWindow.cs
  3. 1
      ScriptableRenderPipeline/HDRenderPipeline/CHANGELOG.md
  4. 5
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs

12
ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugManager.cs


public sealed partial class DebugManager
{
#if UNITY_EDITOR
// HACK: Make debug windows work correctly with FrameSettings in Editor
public static bool renderPipelineIsRecreated = false;
#endif
static readonly DebugManager s_Instance = new DebugManager();
public static DebugManager instance { get { return s_Instance; } }

public event Action<bool> onDisplayRuntimeUIChanged = delegate { };
public event Action onSetDirty = delegate { };
public bool refreshEditorRequested;
GameObject m_Root;
DebugUIHandlerCanvas m_RootUICanvas;

{
RegisterInputs();
RegisterActions();
}
public void RefreshEditor()
{
refreshEditorRequested = true;
}
public void Reset()

18
ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugWindow.cs


void OnEnable()
{
DebugManager.instance.refreshEditorRequested = false;
hideFlags = HideFlags.HideAndDontSave;
autoRepaintOnSceneChange = true;

EditorApplication.update -= Repaint;
var panels = DebugManager.instance.panels;
var selectedPanelIndex = m_Settings.selectedPanel;
if (selectedPanelIndex >= 0
&& selectedPanelIndex < panels.Count
if (selectedPanelIndex >= 0
&& selectedPanelIndex < panels.Count
&& panels[selectedPanelIndex].editorForceUpdate)
EditorApplication.update += Repaint;
}

void Update()
{
// HACK: Make debug windows work correctly with FrameSettings in Editor
// When we manipulate the framesettings on HDRenderPipelineAsset, the debug windows is not
// refresh, it keep the old state of the runtime framesettings in memory and thus overwrite
// our freshly edited value. To ensure debug windows is aware of framesettings change we need to
// destroy its internal widget state.
if (DebugManager.renderPipelineIsRecreated)
// If the render pipeline asset has been reloaded we force-refresh widget states in case
// some debug values need to be refresh/recreated as well (e.g. frame settings on HD)
if (DebugManager.instance.refreshEditorRequested)
DebugManager.renderPipelineIsRecreated = false;
DebugManager.instance.refreshEditorRequested = false;
// END HACK
int treeState = DebugManager.instance.GetState();

1
ScriptableRenderPipeline/HDRenderPipeline/CHANGELOG.md


- Fix issue with shadow mask framesettings not correctly taken into account when shadow mask is enabled for lighting.
- Fix directional light and shadow mask transition, they are now matching making smooth transition
- Fix banding issues caused by high intensity volumetric lighting
- Fix the debug window being emptied on SRP asset reload
## [2018.1.0f2]

5
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs


public HDRenderPipeline(HDRenderPipelineAsset asset)
{
#if UNITY_EDITOR
// HACK: Make debug windows work correctly with FrameSettings in Editor
DebugManager.renderPipelineIsRecreated = true;
#endif
DebugManager.instance.RefreshEditor();
m_ValidAPI = true;

正在加载...
取消
保存