summaryrefslogtreecommitdiffstats
path: root/Editor
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2024-08-10 01:08:46 -0700
committeryum <yum.food.vr@gmail.com>2024-08-10 01:08:46 -0700
commit1aa73f3471b12d5fed9feb76a25c40ccf3969ce8 (patch)
treee11918f10da37d6f8623f68f83062e0098a1902a /Editor
parent2f48ee027587845df67214607f9cefc0e620d653 (diff)
Add metallic/roughness to decals
Also add ability to limit cubemap override to metallic regions of material. Also rename `uv` to `uv0` where appropriate. This is to begin supporting multiple UV maps.
Diffstat (limited to 'Editor')
-rw-r--r--Editor/tooner.cs29
1 files changed, 29 insertions, 0 deletions
diff --git a/Editor/tooner.cs b/Editor/tooner.cs
index 166241d..76aaffc 100644
--- a/Editor/tooner.cs
+++ b/Editor/tooner.cs
@@ -316,6 +316,19 @@ public class ToonerGUI : ShaderGUI {
if (bc.textureValue) {
editor.TextureScaleOffsetProperty(bc);
}
+
+ bc = FindProperty($"_Decal{i}_Roughness");
+ editor.TexturePropertySingleLine(
+ MakeLabel(bc, "Roughness"),
+ bc);
+ SetKeyword($"_DECAL{i}_ROUGHNESS", bc.textureValue);
+
+ bc = FindProperty($"_Decal{i}_Metallic");
+ editor.TexturePropertySingleLine(
+ MakeLabel(bc, "Metallic"),
+ bc);
+ SetKeyword($"_DECAL{i}_METALLIC", bc.textureValue);
+
bc = FindProperty($"_Decal{i}_Emission_Strength");
editor.FloatProperty(
bc,
@@ -324,6 +337,12 @@ public class ToonerGUI : ShaderGUI {
editor.RangeProperty(
bc,
"Angle");
+
+ bc = FindProperty($"_Decal{i}_UV_Select");
+ editor.RangeProperty(
+ bc,
+ "UV");
+
}
EditorGUI.indentLevel -= 1;
@@ -1355,6 +1374,16 @@ public class ToonerGUI : ShaderGUI {
bc);
SetKeyword("_CUBEMAP", bc.textureValue);
+ if (bc.textureValue) {
+ bc = FindProperty("_Cubemap_Limit_To_Metallic");
+ bool cube_lim_enabled = bc.floatValue > 1E-6;
+ EditorGUI.BeginChangeCheck();
+ cube_lim_enabled = EditorGUILayout.Toggle("Limit to metallic",
+ cube_lim_enabled);
+ EditorGUI.EndChangeCheck();
+ bc.floatValue = cube_lim_enabled ? 1.0f : 0.0f;
+ }
+
bc = FindProperty("_Lighting_Factor");
editor.RangeProperty(
bc,