Files
com.misaki.hdrp-toon/Editor/MeterialEditor/UTSShaderGUI.cs
Misaki b205c1523d Added AdvanceScope;
Added energy conservation to diffuse lighting;
Clean up shader properties;
2025-03-23 21:30:34 +09:00

51 lines
1.5 KiB
C#

using Misaki.ShaderGUI;
using UnityEditor;
using UnityEngine;
namespace Misaki.HdrpToon.Editor
{
public class UTSShaderGUI : ScopedShaderGUI
{
private GUIStyle _headerStyle;
public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties)
{
if (!initialized)
{
OnInitialize(materialEditor, properties);
}
EditorGUILayout.Space(10);
EditorGUILayout.LabelField("HDRP Toon Shader", _headerStyle);
EditorGUILayout.Space(20);
DrawShaderGUI(properties);
}
private void OnInitialize(MaterialEditor materialEditor, MaterialProperty[] properties)
{
AddUIScope(new SurfaceOptionsScope());
AddUIScope(new ShadingColorScope());
AddUIScope(new ShadowScope());
AddUIScope(new SurfaceInputsScope());
AddUIScope(new AmbientScope());
AddUIScope(new RimLightScope());
AddUIScope(new AngelRingScope());
AddUIScope(new OutlineScope());
AddUIScope(new AdvanceScope());
Initialize(materialEditor, properties);
_headerStyle = new GUIStyle()
{
fontSize = 25,
fontStyle = FontStyle.Bold,
alignment = TextAnchor.MiddleCenter,
normal =
{
textColor = GUI.skin.label.normal.textColor
}
};
}
}
}