diff options
| author | yum <yum.food.vr@gmail.com> | 2024-04-25 15:52:24 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2024-04-25 15:52:24 -0700 |
| commit | 6eed98ff4e57326ebf7a41f0c180635a7bcac626 (patch) | |
| tree | 67f5e269bafb49608cab8a6b22534d83fd09b58b /Editor | |
| parent | b9671b47df8b17fa3143d4b0dbdecf9b77cc7607 (diff) | |
Add LTCGI
Also begin trying to fix fallback shaders.
Diffstat (limited to 'Editor')
| -rw-r--r-- | Editor/tooner.cs | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/Editor/tooner.cs b/Editor/tooner.cs index 44306be..0d4fcb6 100644 --- a/Editor/tooner.cs +++ b/Editor/tooner.cs @@ -658,9 +658,29 @@ public class ToonerGUI : ShaderGUI { } } - void DoMain() { - SetKeyword("VERTEXLIGHT_ON", false); + void DoLTCGI() { +#if LTCGI_INCLUDED + GUILayout.Label($"Available: yes"); + + MaterialProperty bc = FindProperty("_LTCGI_Enabled"); + bool enabled = bc.floatValue > 1E-6; + EditorGUI.BeginChangeCheck(); + enabled = EditorGUILayout.Toggle("Enable", enabled); + EditorGUI.EndChangeCheck(); + bc.floatValue = enabled ? 1.0f : 0.0f; + SetKeyword("_LTCGI", enabled); + bc = FindProperty("_LTCGI_SpecularColor"); + editor.ColorProperty(bc, "Specular color (RGB)"); + + bc = FindProperty("_LTCGI_DiffuseColor"); + editor.ColorProperty(bc, "Diffuse color (RGB)"); +#else + GUILayout.Label($"Available: no"); +#endif // LTCGI_INCLUDED + } + + void DoMain() { GUILayout.Label("PBR", EditorStyles.boldLabel); EditorGUI.indentLevel += 1; DoBaseColor(); @@ -739,6 +759,11 @@ public class ToonerGUI : ShaderGUI { EditorGUI.indentLevel += 1; DoRendering(); EditorGUI.indentLevel -= 1; + + GUILayout.Label("LTCGI", EditorStyles.boldLabel); + EditorGUI.indentLevel += 1; + DoLTCGI(); + EditorGUI.indentLevel -= 1; } } |
