diff options
| author | yum <yum.food.vr@gmail.com> | 2024-08-11 12:37:54 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2024-08-11 12:37:54 -0700 |
| commit | 5528b313bb1b6b85aa7b779e7170e0ec1bbd2590 (patch) | |
| tree | c527ec9c4578fc46caff95e5da8e97ec8f726905 /Editor | |
| parent | bcba7f9bdb8a12314eff05f666b2c6e01d4d5818 (diff) | |
Rim lighting now supports second UV channel
Also add clamp/repeat sampler controls to rim lighting.
Diffstat (limited to 'Editor')
| -rw-r--r-- | Editor/tooner.cs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Editor/tooner.cs b/Editor/tooner.cs index 7610e5b..e0a8bfc 100644 --- a/Editor/tooner.cs +++ b/Editor/tooner.cs @@ -528,12 +528,31 @@ public class ToonerGUI : ShaderGUI { SetKeyword($"_RIM_LIGHTING{i}_MASK", bc.textureValue); if (bc.textureValue) { + EditorGUI.indentLevel += 1; + bc = FindProperty($"_Rim_Lighting{i}_Mask_Invert"); enabled = bc.floatValue > 1E-6; EditorGUI.BeginChangeCheck(); enabled = EditorGUILayout.Toggle("Invert mask", enabled); EditorGUI.EndChangeCheck(); bc.floatValue = enabled ? 1.0f : 0.0f; + + bc = FindProperty($"_Rim_Lighting{i}_Mask_UV_Select"); + editor.RangeProperty( + bc, + "UV channel"); + + bc = FindProperty($"_Rim_Lighting{i}_Mask_Sampler_Mode"); + SamplerMode sampler_mode = (SamplerMode) Math.Round(bc.floatValue); + sampler_mode = (SamplerMode) EditorGUILayout.EnumPopup( + MakeLabel("Sampler mode"), sampler_mode); + EditorGUI.EndChangeCheck(); + bc.floatValue = (int) sampler_mode; + + SetKeyword($"_RIM_LIGHTING{i}_SAMPLER_REPEAT", sampler_mode == SamplerMode.Repeat); + SetKeyword($"_RIM_LIGHTING{i}_SAMPLER_CLAMP", sampler_mode == SamplerMode.Clamp); + + EditorGUI.indentLevel -= 1; } EditorGUI.BeginChangeCheck(); |
