summaryrefslogtreecommitdiffstats
path: root/Editor
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2024-08-19 16:04:47 -0700
committeryum <yum.food.vr@gmail.com>2024-08-19 16:04:47 -0700
commitbf9496af5f27d548224689a123e97546fc2053b7 (patch)
tree0110d78690ff0bafd0e1b698c5287badde74a398 /Editor
parentcc4347e460a445f60e6e5b03d055c65b5cdfdbd6 (diff)
Add HSV, global emissions multiplier
Also bugfix overlays 1-3 ifdefs.
Diffstat (limited to 'Editor')
-rw-r--r--Editor/tooner.cs52
1 files changed, 51 insertions, 1 deletions
diff --git a/Editor/tooner.cs b/Editor/tooner.cs
index 53bdc46..4e96e61 100644
--- a/Editor/tooner.cs
+++ b/Editor/tooner.cs
@@ -400,6 +400,9 @@ public class ToonerGUI : ShaderGUI {
bc,
bct);
SetKeyword("_EMISSION", bc.textureValue);
+
+ bc = FindProperty("_Global_Emission_Factor");
+ editor.FloatProperty(bc, "Global emissions multiplier");
}
enum MatcapMode {
@@ -721,6 +724,48 @@ public class ToonerGUI : ShaderGUI {
}
}
+ void DoHSV() {
+ MaterialProperty bc;
+
+ bc = FindProperty("_HSV_Enabled");
+ bool enabled = bc.floatValue > 1E-6;
+ EditorGUI.BeginChangeCheck();
+ enabled = EditorGUILayout.Toggle("Enable", enabled);
+ EditorGUI.EndChangeCheck();
+ bc.floatValue = enabled ? 1.0f : 0.0f;
+
+ SetKeyword("_HSV", enabled);
+
+ if (enabled) {
+ bc = FindProperty("_HSV_Mask");
+ editor.TexturePropertySingleLine(
+ MakeLabel(bc, "Mask"),
+ bc);
+
+ if (bc.textureValue) {
+ bc = FindProperty("_HSV_Mask_Invert");
+ enabled = bc.floatValue > 1E-6;
+ EditorGUI.BeginChangeCheck();
+ enabled = EditorGUILayout.Toggle("Invert", enabled);
+ EditorGUI.EndChangeCheck();
+ bc.floatValue = enabled ? 1.0f : 0.0f;
+ }
+
+ bc = FindProperty("_HSV_Hue_Shift");
+ editor.RangeProperty(
+ bc,
+ "Hue shift");
+ bc = FindProperty("_HSV_Sat_Shift");
+ editor.RangeProperty(
+ bc,
+ "Saturation shift");
+ bc = FindProperty("_HSV_Val_Shift");
+ editor.RangeProperty(
+ bc,
+ "Value shift");
+ }
+ }
+
void DoClones() {
MaterialProperty bc;
@@ -1608,11 +1653,16 @@ public class ToonerGUI : ShaderGUI {
DoTessellation();
EditorGUI.indentLevel -= 1;
- GUILayout.Label("Hue shift", EditorStyles.boldLabel);
+ GUILayout.Label("Hue shift (OKLAB)", EditorStyles.boldLabel);
EditorGUI.indentLevel += 1;
DoOKLAB();
EditorGUI.indentLevel -= 1;
+ GUILayout.Label("Hue shift (HSV)", EditorStyles.boldLabel);
+ EditorGUI.indentLevel += 1;
+ DoHSV();
+ EditorGUI.indentLevel -= 1;
+
GUILayout.Label("Clones", EditorStyles.boldLabel);
EditorGUI.indentLevel += 1;
DoClones();