Files
com.misaki.hdrp-toon/Editor/Inspector/DebugShadowmapInspector.cs
Misaki a7a9ad16b5 Updated namespace;
Added UTSPass;
Chnaged the RTHanlde _HairShadowMap to not reallocate when screen resolution decreased;
2025-01-08 22:19:04 +09:00

99 lines
2.9 KiB
C#

using UnityEditor;
namespace Misaki.HdrpToon.Editor
{
[CustomEditor(typeof(DebugShadowmap))]
internal class DebugShadowmapInspector : UnityEditor.Editor
{
public override void OnInspectorGUI()
{
const string labelDebugShadowmap = "Show Shadowmap";
const string labelDebugSelfShadow = "Show SelfShadow";
const string labelBinalization = "Binalization";
const string labelNoOutline = "No Outline";
var isChanged = false;
var obj = target as DebugShadowmap;
// hi cut filter
EditorGUI.BeginChangeCheck();
var showShadow = EditorGUILayout.Toggle(labelDebugShadowmap, obj.m_enableShadowmapDebugging);
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(target, "Changed Shadowmap debbuging flag");
obj.m_enableShadowmapDebugging = showShadow;
isChanged = true;
}
EditorGUI.BeginDisabledGroup(!obj.m_enableShadowmapDebugging);
{
EditorGUI.indentLevel++;
EditorGUILayout.BeginHorizontal();
EditorGUI.BeginChangeCheck();
var binalization = EditorGUILayout.Toggle(labelBinalization, obj.m_enableBinalization);
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(target, "Changed Binalization flag");
obj.m_enableBinalization = binalization;
isChanged = true;
}
EditorGUILayout.EndHorizontal();
EditorGUI.indentLevel--;
}
EditorGUI.EndDisabledGroup();
EditorGUILayout.BeginHorizontal();
EditorGUI.BeginChangeCheck();
var showSlefShadow = EditorGUILayout.Toggle(labelDebugSelfShadow, obj.m_enableSelfShadowDebugging);
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(target, "Changed Self shadow debbuging flag");
obj.m_enableSelfShadowDebugging = showSlefShadow;
isChanged = true;
}
EditorGUILayout.EndHorizontal();
EditorGUILayout.BeginHorizontal();
EditorGUI.BeginChangeCheck();
var showOutline = EditorGUILayout.Toggle(labelNoOutline, obj.m_enableOutlineDebugging);
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(target, "Changed Outline flag");
obj.m_enableOutlineDebugging = showOutline;
isChanged = true;
}
EditorGUILayout.EndHorizontal();
if (isChanged)
{
// at leaset 2020.3.12f1, not neccessary. but, from which version??
EditorApplication.QueuePlayerLoopUpdate();
}
}
}
}