diff options
| author | yum <yum.food.vr@gmail.com> | 2024-08-20 13:45:54 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2024-08-20 13:45:54 -0700 |
| commit | b7407fa9d7a917f7d62a7a2e12f96e90af11215c (patch) | |
| tree | b370eee4fb844036ac767eeb62ce166359225682 /Editor | |
| parent | bf9496af5f27d548224689a123e97546fc2053b7 (diff) | |
Add normals replace option to matcap
Also add mix factor slider so you can animate matcap opacity. This is
useful for adding things like bodysuits.
Diffstat (limited to 'Editor')
| -rw-r--r-- | Editor/tooner.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Editor/tooner.cs b/Editor/tooner.cs index 4e96e61..4d96d76 100644 --- a/Editor/tooner.cs +++ b/Editor/tooner.cs @@ -480,6 +480,11 @@ public class ToonerGUI : ShaderGUI { bc, "Matcap strength"); + bc = FindProperty($"_Matcap{i}MixFactor"); + editor.RangeProperty( + bc, + "Mix factor"); + bc = FindProperty($"_Matcap{i}Emission"); editor.FloatProperty( bc, @@ -490,6 +495,29 @@ public class ToonerGUI : ShaderGUI { bc, "Quantization"); + bc = FindProperty($"_Matcap{i}Normal_Enabled"); + enabled = bc.floatValue > 1E-6; + EditorGUI.BeginChangeCheck(); + enabled = EditorGUILayout.Toggle("Replace normals", enabled); + EditorGUI.EndChangeCheck(); + bc.floatValue = enabled ? 1.0f : 0.0f; + SetKeyword($"_MATCAP{i}_NORMAL", enabled); + + if (enabled) { + EditorGUI.indentLevel += 1; + bc = FindProperty($"_Matcap{i}Normal"); + editor.TexturePropertySingleLine( + MakeLabel(bc, "Normal map"), + bc); + if (bc.textureValue) { + editor.TextureScaleOffsetProperty(bc); + + bc = FindProperty($"_Matcap{i}Normal_Str"); + editor.RangeProperty(bc, "Strength"); + } + EditorGUI.indentLevel -= 1; + } + bc = FindProperty($"_Matcap{i}Distortion0"); enabled = bc.floatValue > 1E-6; EditorGUI.BeginChangeCheck(); |
