summaryrefslogtreecommitdiffstats
path: root/Editor
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2024-10-25 15:05:56 -0700
committeryum <yum.food.vr@gmail.com>2024-10-25 15:05:56 -0700
commit94f37fa8dd94137a910df4ebc80f98db2d685f08 (patch)
tree4a4b77203f1f4fa911ea4fa9a351a1d6ed911f2d /Editor
parent1705cd25f5bcd796a560bcce22ef91d190a94900 (diff)
Add features for constant rim lighting view direction
Add vector to control rim lighting view dir (y does nothing) and toggle to enable doing reflection calculation in world space.
Diffstat (limited to 'Editor')
-rw-r--r--Editor/tooner.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/Editor/tooner.cs b/Editor/tooner.cs
index bd98d37..deb2357 100644
--- a/Editor/tooner.cs
+++ b/Editor/tooner.cs
@@ -936,6 +936,29 @@ public class ToonerGUI : ShaderGUI {
EditorGUI.indentLevel -= 1;
}
+ bc = FindProperty($"_Rim_Lighting{i}_Custom_View_Vector_Enabled");
+ enabled = bc.floatValue > 1E-6;
+ EditorGUI.BeginChangeCheck();
+ enabled = Toggle("Custom view vector", enabled);
+ EditorGUI.EndChangeCheck();
+ bc.floatValue = enabled ? 1.0f : 0.0f;
+ SetKeyword($"_RIM_LIGHTING{i}_CUSTOM_VIEW_VECTOR", enabled);
+
+ if (enabled) {
+ EditorGUI.indentLevel += 1;
+ bc = FindProperty($"_Rim_Lighting{i}_Custom_View_Vector");
+ VectorProperty(bc, "Vector");
+ EditorGUI.indentLevel -= 1;
+ }
+
+ bc = FindProperty($"_Rim_Lighting{i}_Reflect_In_World_Space");
+ enabled = bc.floatValue > 1E-6;
+ EditorGUI.BeginChangeCheck();
+ enabled = Toggle("Reflect in world space", enabled);
+ EditorGUI.EndChangeCheck();
+ bc.floatValue = enabled ? 1.0f : 0.0f;
+ SetKeyword($"_RIM_LIGHTING{i}_REFLECT_IN_WORLD", enabled);
+
EditorGUI.indentLevel -= 1;
show_ui.RemoveAt(show_ui.Count - 1);
}