summaryrefslogtreecommitdiffstats
path: root/Editor/tooner.cs
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2024-11-03 15:25:08 -0800
committeryum <yum.food.vr@gmail.com>2024-11-03 15:25:54 -0800
commitb7d3cb5d759feab1e44f4cdb01a0c8922bf4f1cb (patch)
treecc10c40ac2e632dd07a0ac0fe515048b354af7f9 /Editor/tooner.cs
parentcb55e813456480a036673d1d32608e10b10c8f87 (diff)
Misc
* Add third HSV slot * Add ZTest enum * Fix bug where SSR mask keyword can be set when SSR is disabled
Diffstat (limited to 'Editor/tooner.cs')
-rw-r--r--Editor/tooner.cs27
1 files changed, 26 insertions, 1 deletions
diff --git a/Editor/tooner.cs b/Editor/tooner.cs
index fdd81b0..f6f3da8 100644
--- a/Editor/tooner.cs
+++ b/Editor/tooner.cs
@@ -1082,7 +1082,7 @@ public class ToonerGUI : ShaderGUI {
MaterialProperty bc;
- for (int i = 0; i < 2; i++) {
+ for (int i = 0; i < 3; i++) {
bc = FindProperty($"_HSV{i}_Enabled");
bool enabled = bc.floatValue > 1E-6;
EditorGUI.BeginChangeCheck();
@@ -2347,6 +2347,8 @@ public class ToonerGUI : ShaderGUI {
SetKeyword("SSR_MASK", bc.textureValue);
EditorGUI.indentLevel -= 1;
+ } else {
+ SetKeyword("SSR_MASK", false);
}
EditorGUI.indentLevel -= 1;
@@ -2366,6 +2368,21 @@ public class ToonerGUI : ShaderGUI {
Stochastic
}
+ // unity is made by fucking morons and they don't expose this so i'm
+ // reimplementing it
+ // ref: https://docs.unity3d.com/6000.0/Documentation/Manual/SL-ZTest.html
+ enum ZTestMode {
+ Disabled,
+ Never,
+ Less,
+ Equal,
+ LEqual,
+ Greater,
+ NotEqual,
+ GEqual,
+ Always
+ }
+
void DoRendering() {
show_ui.Add(AddCollapsibleMenu("Rendering", "_Rendering"));
EditorGUI.indentLevel += 1;
@@ -2479,6 +2496,14 @@ public class ToonerGUI : ShaderGUI {
bc.floatValue = (float) cull_mode;
}
+ EditorGUI.BeginChangeCheck();
+ bc = FindProperty("_ZTest");
+ ZTestMode zmode = (ZTestMode) Math.Round(bc.floatValue);
+ zmode = (ZTestMode) EnumPopup(
+ MakeLabel("ZTest"), zmode);
+ EditorGUI.EndChangeCheck();
+ bc.floatValue = (float) zmode;
+
bc = FindProperty("_Discard_Enable_Static");
bool enabled = bc.floatValue > 1E-6;
EditorGUI.BeginChangeCheck();