From 94f37fa8dd94137a910df4ebc80f98db2d685f08 Mon Sep 17 00:00:00 2001 From: yum Date: Fri, 25 Oct 2024 15:05:56 -0700 Subject: 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. --- Editor/tooner.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'Editor/tooner.cs') 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); } -- cgit v1.2.3