Added AdvanceScope;
Added energy conservation to diffuse lighting; Clean up shader properties;
This commit is contained in:
@@ -19,5 +19,6 @@ namespace Misaki.HdrpToon.Editor
|
||||
SceneLight = 1 << 14,
|
||||
EnvironmentalLightEffectiveness = 1 << 15,
|
||||
MetaverseSettings = 1 << 16,
|
||||
Advance = 1 << 17,
|
||||
}
|
||||
}
|
||||
|
||||
47
Editor/MeterialEditor/UIScopes/AdvanceScope.cs
Normal file
47
Editor/MeterialEditor/UIScopes/AdvanceScope.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using Misaki.ShaderGUI;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
using static Misaki.HdrpToon.UtsShaderPropertyName.Advance;
|
||||
|
||||
namespace Misaki.HdrpToon.Editor
|
||||
{
|
||||
public class AdvanceScope : MaterialUIScope<ShaderGUIExpandable>
|
||||
{
|
||||
private static class Properties
|
||||
{
|
||||
public static MaterialProperty lightIntensityMultiplier;
|
||||
public static MaterialProperty clampLightColor;
|
||||
|
||||
public static MaterialProperty lightLoopMode;
|
||||
}
|
||||
|
||||
private static class Styles
|
||||
{
|
||||
public static readonly GUIContent lightIntensityMultiplierText = new("Light Intensity Multiplier", "Specifies the intensity multiplier of the light.");
|
||||
public static readonly GUIContent clampLightColorText = new("Clamp Light Color", "Specifies whether to clamp the light color.");
|
||||
|
||||
public static readonly GUIContent lightLoopModeText = new("Light Loop Mode", "Specifies the light loop mode.");
|
||||
}
|
||||
|
||||
protected override ShaderGUIExpandable ExpandableBit => ShaderGUIExpandable.Advance;
|
||||
|
||||
protected override GUIContent Header => EditorGUIUtility.TrTextContent("Advance Settings");
|
||||
|
||||
public override void LoadMaterialProperties()
|
||||
{
|
||||
Properties.lightIntensityMultiplier = FindProperty(LIGHT_INTENSITY_MULTIPLIER);
|
||||
Properties.clampLightColor = FindProperty(CLAMP_LIGHT_COLOR);
|
||||
|
||||
Properties.lightLoopMode = FindProperty(LIGHT_LOOP_MODE);
|
||||
}
|
||||
|
||||
protected override void DrawContent()
|
||||
{
|
||||
editor.ShaderProperty(Properties.lightIntensityMultiplier, Styles.lightIntensityMultiplierText);
|
||||
editor.ShaderProperty(Properties.clampLightColor, Styles.clampLightColorText);
|
||||
|
||||
editor.ShaderProperty(Properties.lightLoopMode, Styles.lightLoopModeText);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Editor/MeterialEditor/UIScopes/AdvanceScope.cs.meta
Normal file
2
Editor/MeterialEditor/UIScopes/AdvanceScope.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3acfee7f0a1007e4bb2a3b42a6282d52
|
||||
@@ -129,6 +129,7 @@ namespace Misaki.HdrpToon.Editor
|
||||
|
||||
if (materials.All(mat => mat.GetPBRMode() == PBRMode.Anisotropy || mat.GetPBRMode() == PBRMode.KKHair))
|
||||
{
|
||||
EditorGUILayout.Space();
|
||||
editor.KeywordTexturePropertySingleLine(Styles.AnisotropyMapText, Properties.AnisotropyMap, Properties.Anisotropy);
|
||||
if (materials.All(mat => mat.GetPBRMode() == PBRMode.KKHair))
|
||||
{
|
||||
@@ -142,6 +143,7 @@ namespace Misaki.HdrpToon.Editor
|
||||
}
|
||||
else if (materials.All(mat => mat.GetPBRMode() == PBRMode.Toon))
|
||||
{
|
||||
EditorGUILayout.Space();
|
||||
editor.KeywordTexturePropertySingleLine(Styles.SpecularColorMapText, Properties.SpecularColorMap, Properties.SpecularColor);
|
||||
editor.MinMaxShaderProperty(Properties.SpecularFeather, Properties.SpecularStep, 0, 1, Styles.SpecRemap);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace Misaki.HdrpToon.Editor
|
||||
AddUIScope(new RimLightScope());
|
||||
AddUIScope(new AngelRingScope());
|
||||
AddUIScope(new OutlineScope());
|
||||
AddUIScope(new AdvanceScope());
|
||||
|
||||
Initialize(materialEditor, properties);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user