Updated OutlineScope;

Reorgnize shader code;
This commit is contained in:
2025-02-03 13:46:31 +09:00
parent 281dfbc4f0
commit 886432db7b
24 changed files with 275 additions and 293 deletions

View File

@@ -42,21 +42,6 @@ namespace Misaki.HdrpToon.Editor
protected override GUIContent Header => EditorGUIUtility.TrTextContent("Surface Options");
public static ShadingMode GetShadingMode()
{
return (ShadingMode)Properties.shadingMode.floatValue;
}
public static PBRMode GetPBRMode()
{
return (PBRMode)Properties.pbrMode.floatValue;
}
public static bool HasFeature(SurfaceFeatureFlags feature)
{
return ((SurfaceFeatureFlags)Properties.surfaceFeatures.floatValue & feature) != 0;
}
public override void LoadMaterialProperties()
{
Properties.transparentMode = FindProperty("_TransparentEnabled");
@@ -100,17 +85,7 @@ namespace Misaki.HdrpToon.Editor
}
}
var surfaceFeatures = (SurfaceFeatureFlags)Properties.surfaceFeatures.floatValue;
EditorGUI.BeginChangeCheck();
surfaceFeatures = (SurfaceFeatureFlags)EditorGUILayout.EnumFlagsField(Styles.surfaceFeaturesText, surfaceFeatures);
if (EditorGUI.EndChangeCheck())
{
Properties.surfaceFeatures.floatValue = (float)surfaceFeatures;
foreach (var material in editor.GetMaterials())
{
material.SetShaderPassEnabled(UtsShaderPassName.OUTLINE_PASS_NAME, HasFeature(SurfaceFeatureFlags.Outline));
}
}
editor.ShaderProperty(Properties.surfaceFeatures, Styles.surfaceFeaturesText);
}
}
}