diff options
| author | yum <yum.food.vr@gmail.com> | 2024-07-13 01:49:03 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2024-07-13 01:49:21 -0700 |
| commit | bf4457b96cd46ed2d3d61bde2eb4d58d3114730b (patch) | |
| tree | 00c2e9c18f15dc2decd54666e96254e9176102dd /Editor/tooner.cs | |
| parent | d0032ecf7d258ac52ef572e26f64e18190bf9215 (diff) | |
Integrate metallic eye shader
Diffstat (limited to 'Editor/tooner.cs')
| -rw-r--r-- | Editor/tooner.cs | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/Editor/tooner.cs b/Editor/tooner.cs index 9dc90c6..23a93ef 100644 --- a/Editor/tooner.cs +++ b/Editor/tooner.cs @@ -475,7 +475,8 @@ public class ToonerGUI : ShaderGUI { enum NormalsMode { Flat, - Spherical + Spherical, + Realistic }; void DoShadingMode() { @@ -889,9 +890,65 @@ public class ToonerGUI : ShaderGUI { EditorGUI.indentLevel -= 1; } + void DoGimmickShearLocation() { + MaterialProperty bc; + bc = FindProperty("_Gimmick_Shear_Location_Enable_Static"); + bool enabled = (bc.floatValue != 0.0); + EditorGUI.BeginChangeCheck(); + enabled = EditorGUILayout.Toggle("Shear location", enabled); + EditorGUI.EndChangeCheck(); + bc.floatValue = enabled ? 1.0f : 0.0f; + SetKeyword("_GIMMICK_SHEAR_LOCATION", enabled); + + if (!enabled) { + return; + } + + EditorGUI.indentLevel += 1; + + bc = FindProperty("_Gimmick_Shear_Location_Enable_Dynamic"); + enabled = (bc.floatValue != 0.0); + EditorGUI.BeginChangeCheck(); + enabled = EditorGUILayout.Toggle("Enable (runtime switch)", enabled); + EditorGUI.EndChangeCheck(); + bc.floatValue = enabled ? 1.0f : 0.0f; + + bc = FindProperty("_Gimmick_Shear_Location_Strength"); + editor.VectorProperty(bc, "Strength"); + + EditorGUI.indentLevel -= 1; + } + + void DoGimmickEyes00() { + MaterialProperty bc; + bc = FindProperty("_Gimmick_Eyes00_Enable_Static"); + bool enabled = (bc.floatValue != 0.0); + EditorGUI.BeginChangeCheck(); + enabled = EditorGUILayout.Toggle("Eyes 00", enabled); + EditorGUI.EndChangeCheck(); + bc.floatValue = enabled ? 1.0f : 0.0f; + SetKeyword("_GIMMICK_EYES_00", enabled); + + if (!enabled) { + return; + } + + EditorGUI.indentLevel += 1; + + bc = FindProperty("_Gimmick_Eyes00_Effect_Mask"); + editor.TexturePropertySingleLine( + MakeLabel(bc, "Effect mask"), + bc); + + EditorGUI.indentLevel -= 1; + } + + void DoGimmicks() { DoGimmickFlatColor(); DoGimmickQuantizeLocation(); + DoGimmickShearLocation(); + DoGimmickEyes00(); } enum RenderingMode { |
