diff options
| author | yum <yum.food.vr@gmail.com> | 2024-09-13 14:05:27 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2024-09-13 14:05:27 -0700 |
| commit | 7875e0a656a4bc8802ce7365baa34be3be20dac4 (patch) | |
| tree | f34166e7bfb02eb190a2ca381a150e86e9c679a2 | |
| parent | 532921487d52418357d00f499d13b23a47644a58 (diff) | |
Convert mochie params to range/toggle
| -rw-r--r-- | Editor/tooner.cs | 16 | ||||
| -rw-r--r-- | tooner.shader | 12 |
2 files changed, 17 insertions, 11 deletions
diff --git a/Editor/tooner.cs b/Editor/tooner.cs index 8cfbecb..9c07691 100644 --- a/Editor/tooner.cs +++ b/Editor/tooner.cs @@ -1689,15 +1689,21 @@ public class ToonerGUI : ShaderGUI { MaterialProperty bc; bc = FindProperty("_WrappingFactor"); - editor.FloatProperty(bc, "Wrapping factor"); + editor.RangeProperty(bc, "Wrapping factor"); bc = FindProperty("_SpecularStrength"); - editor.FloatProperty(bc, "Specular strength"); + editor.RangeProperty(bc, "Specular strength"); bc = FindProperty("_FresnelStrength"); - editor.FloatProperty(bc, "Fresnel strength"); + editor.RangeProperty(bc, "Fresnel strength"); + bc = FindProperty("_UseFresnel"); - editor.FloatProperty(bc, "Use fresnel"); + bool enabled = bc.floatValue > 1E-6; + EditorGUI.BeginChangeCheck(); + enabled = EditorGUILayout.Toggle("Use fresnel", enabled); + EditorGUI.EndChangeCheck(); + bc.floatValue = enabled ? 1.0f : 0.0f; + bc = FindProperty("_ReflectionStrength"); - editor.FloatProperty(bc, "Reflection strength"); + editor.RangeProperty(bc, "Reflection strength"); EditorGUI.indentLevel -= 1; } diff --git a/tooner.shader b/tooner.shader index 5326f20..6ab0076 100644 --- a/tooner.shader +++ b/tooner.shader @@ -503,12 +503,12 @@ Shader "yum_food/tooner" _ScatterAmbient("_ScatterAmbient", Float) = 0 _GSAA("_GSAA", Float) = 0 _GSAAStrength("_GSAAStrength", Float) = 0 - _WrappingFactor("_WrappingFactor", Float) = 0 + _WrappingFactor("_WrappingFactor", Range(0,1)) = 0 _Subsurface("_Subsurface", Float) = 0 - _SpecularStrength("_SpecularStrength", Float) = 1 - _FresnelStrength("_FresnelStrength", Float) = 1 + _SpecularStrength("_SpecularStrength", Range(0,1)) = 1 + _FresnelStrength("_FresnelStrength", Range(0,1)) = 1 _UseFresnel("_UseFresnel", Float) = 1 - _ReflectionStrength("_ReflectionStrength", Float) = 1 + _ReflectionStrength("_ReflectionStrength", Range(0,1)) = 1 shadowedReflections("shadowedReflections", Vector) = (0, 0, 0, 0) _ReflShadows("_ReflShadows", Vector) = (0, 0, 0, 0) _ReflShadowStrength("_ReflShadowStrength", Vector) = (0, 0, 0, 0) @@ -528,7 +528,7 @@ Shader "yum_food/tooner" _Decal1_UI_Show("UI hide", Float) = 0 _Decal2_UI_Show("UI hide", Float) = 0 _Decal3_UI_Show("UI hide", Float) = 0 - _Lighting_UI_Show("UI hide", Float) = 1 + _Lighting_UI_Show("UI hide", Float) = 0 _Emission_UI_Show("UI hide", Float) = 0 _Shading_UI_Show("UI hide", Float) = 0 _Matcaps_UI_Show("UI hide", Float) = 0 @@ -541,7 +541,7 @@ Shader "yum_food/tooner" _Outlines_UI_Show("UI hide", Float) = 0 _Glitter_UI_Show("UI hide", Float) = 0 _Gimmicks_UI_Show("UI hide", Float) = 0 - _Rendering_UI_Show("UI hide", Float) = 1 + _Rendering_UI_Show("UI hide", Float) = 0 _Explosion_UI_Show("UI hide", Float) = 0 _Geometry_Scroll_UI_Show("UI hide", Float) = 0 _UV_Scroll_UI_Show("UI hide", Float) = 0 |
