From 312d7acc39b4dc33edd3fdc3d3d77d373b5cb198 Mon Sep 17 00:00:00 2001 From: yum Date: Tue, 25 Jun 2024 19:35:35 -0700 Subject: Add glitter option to rim lighting Now rim lighting can illuminate the avatar as if it has glitter on it. Also deprecate glitter seed, since it was unused. --- Editor/tooner.cs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'Editor') diff --git a/Editor/tooner.cs b/Editor/tooner.cs index 33b23ac..9190f0f 100644 --- a/Editor/tooner.cs +++ b/Editor/tooner.cs @@ -371,6 +371,40 @@ public class ToonerGUI : ShaderGUI { bc, "Rim lighting emission"); + bc = FindProperty($"_Rim_Lighting{i}_Glitter_Enabled"); + enabled = bc.floatValue > 1E-6; + EditorGUI.BeginChangeCheck(); + enabled = EditorGUILayout.Toggle("Glitter", enabled); + EditorGUI.EndChangeCheck(); + bc.floatValue = enabled ? 1.0f : 0.0f; + SetKeyword($"_RIM_LIGHTING{i}_GLITTER", enabled); + + if (enabled) { + EditorGUI.indentLevel += 1; + + bc = FindProperty($"_Rim_Lighting{i}_Glitter_Density"); + editor.FloatProperty( + bc, + "Density"); + + bc = FindProperty($"_Rim_Lighting{i}_Glitter_Amount"); + editor.FloatProperty( + bc, + "Amount"); + + bc = FindProperty($"_Rim_Lighting{i}_Glitter_Speed"); + editor.FloatProperty( + bc, + "Speed"); + + bc = FindProperty($"_Rim_Lighting{i}_Glitter_Quantization"); + editor.FloatProperty( + bc, + "Quantization"); + + EditorGUI.indentLevel -= 1; + } + EditorGUI.indentLevel -= 1; } } -- cgit v1.2.3