Optmize shader structure
This commit is contained in:
@@ -14,6 +14,7 @@ namespace Misaki.HdrpToon.Editor
|
||||
public static MaterialProperty alphaClip;
|
||||
|
||||
public static MaterialProperty cullMode;
|
||||
public static MaterialProperty shadingMode;
|
||||
public static MaterialProperty materialType;
|
||||
public static MaterialProperty pbrMode;
|
||||
|
||||
@@ -30,6 +31,7 @@ namespace Misaki.HdrpToon.Editor
|
||||
public static readonly GUIContent alphaClipText = new("Alpha Clipping Threshold", "Threshold for alpha clipping.");
|
||||
|
||||
public static readonly GUIContent cullingModeText = new("Culling Mode", "Controls the sides of polygons that should not be drawn (culled).");
|
||||
public static readonly GUIContent shadingModeText = new("Shading Mode", "Specifies the shading grade mode.");
|
||||
public static readonly GUIContent materialTypeText = new("Material Type", "Specifies the material type.");
|
||||
public static readonly GUIContent pbrModeText = new("PBR Mode", "Specifies PBR model mode.");
|
||||
|
||||
@@ -42,7 +44,12 @@ namespace Misaki.HdrpToon.Editor
|
||||
|
||||
protected override GUIContent Header => EditorGUIUtility.TrTextContent("Surface Options");
|
||||
|
||||
public bool HasFeature(SurfaceFeatureFlags feature)
|
||||
public static ShadingMode GetShadingMode()
|
||||
{
|
||||
return (ShadingMode)Properties.shadingMode.floatValue;
|
||||
}
|
||||
|
||||
public static bool HasFeature(SurfaceFeatureFlags feature)
|
||||
{
|
||||
return ((SurfaceFeatureFlags)Properties.surfaceFeatures.floatValue & feature) != 0;
|
||||
}
|
||||
@@ -55,6 +62,7 @@ namespace Misaki.HdrpToon.Editor
|
||||
Properties.alphaClip = FindProperty("_AlphaCutoff");
|
||||
|
||||
Properties.cullMode = FindProperty("_CullMode");
|
||||
Properties.shadingMode = FindProperty("_Shading_Mode");
|
||||
Properties.materialType = FindProperty("_Material_Type");
|
||||
Properties.pbrMode = FindProperty("_PBR_Mode");
|
||||
|
||||
@@ -76,6 +84,7 @@ namespace Misaki.HdrpToon.Editor
|
||||
}
|
||||
|
||||
editor.ShaderProperty(Properties.cullMode, Styles.cullingModeText);
|
||||
editor.ShaderProperty(Properties.shadingMode, Styles.shadingModeText);
|
||||
editor.ShaderProperty(Properties.materialType, Styles.materialTypeText);
|
||||
editor.ShaderProperty(Properties.pbrMode, Styles.pbrModeText);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user