diff options
| author | yum <yum.food.vr@gmail.com> | 2024-05-22 13:45:14 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2024-05-22 13:45:14 -0700 |
| commit | cb54d0f9ad63f8937e7834e8e871999447f6e523 (patch) | |
| tree | d8d63001e4db2f1b0057b46432149f7f937adb4b /Editor | |
| parent | a942266a189d2c7b985f812536bb7b654121848a (diff) | |
Add matcap/rim lighting emissions, matcap distortion
Diffstat (limited to 'Editor')
| -rw-r--r-- | Editor/tooner.cs | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/Editor/tooner.cs b/Editor/tooner.cs index a9d53b5..9409dbc 100644 --- a/Editor/tooner.cs +++ b/Editor/tooner.cs @@ -132,7 +132,7 @@ public class ToonerGUI : ShaderGUI { void DoCubemap() { MaterialProperty bc = FindProperty("_Cubemap"); editor.TexturePropertySingleLine( - MakeLabel(bc, "Specular override cubemap"), + MakeLabel(bc, "Cubemap"), bc); SetKeyword("_CUBEMAP", bc.textureValue); } @@ -194,9 +194,10 @@ public class ToonerGUI : ShaderGUI { bc); SetKeyword($"_MATCAP{i}_MASK", bc.textureValue); + bool enabled; // c# is a shitty language if (bc.textureValue) { bc = FindProperty($"_Matcap{i}_Mask_Invert"); - bool enabled = bc.floatValue > 1E-6; + enabled = bc.floatValue > 1E-6; EditorGUI.BeginChangeCheck(); enabled = EditorGUILayout.Toggle("Invert mask", enabled); EditorGUI.EndChangeCheck(); @@ -219,7 +220,20 @@ public class ToonerGUI : ShaderGUI { editor.FloatProperty( bc, "Matcap strength"); + + bc = FindProperty($"_Matcap{i}Emission"); + editor.FloatProperty( + bc, + "Emission strength"); EditorGUI.indentLevel -= 1; + + bc = FindProperty($"_Matcap{i}Distortion0"); + enabled = bc.floatValue > 1E-6; + EditorGUI.BeginChangeCheck(); + enabled = EditorGUILayout.Toggle("Enable distortion 0", enabled); + EditorGUI.EndChangeCheck(); + bc.floatValue = enabled ? 1.0f : 0.0f; + SetKeyword($"_MATCAP{i}_DISTORTION0", enabled); } } @@ -287,6 +301,11 @@ public class ToonerGUI : ShaderGUI { bc, "Strength"); + bc = FindProperty($"_Rim_Lighting{i}_Emission"); + editor.FloatProperty( + bc, + "Rim lighting emission"); + EditorGUI.indentLevel -= 1; } } |
