summaryrefslogtreecommitdiffstats
path: root/Editor
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2024-07-18 15:23:14 -0700
committeryum <yum.food.vr@gmail.com>2024-07-18 15:23:14 -0700
commit82b36c1c14013e82e15ca48dc766eb7aa4198e63 (patch)
treedb54ba20a8ac0d795de992dfe41e9777a5795f71 /Editor
parenta95481afa226d76d671b13515ee2abc59359b87a (diff)
Add individual lighting multipliers
... for direct, indirect x {specular,diffuse}
Diffstat (limited to 'Editor')
-rw-r--r--Editor/tooner.cs36
1 files changed, 29 insertions, 7 deletions
diff --git a/Editor/tooner.cs b/Editor/tooner.cs
index a3af66c..78b9a51 100644
--- a/Editor/tooner.cs
+++ b/Editor/tooner.cs
@@ -1087,11 +1087,6 @@ public class ToonerGUI : ShaderGUI {
}
MaterialProperty bc;
- bc = FindProperty("_Render_Queue_Offset");
- editor.IntegerProperty(
- bc,
- "Render queue offset");
- int queue_offset = bc.intValue;
EditorGUI.BeginChangeCheck();
mode = (RenderingMode) EditorGUILayout.EnumPopup(
@@ -1099,9 +1094,16 @@ public class ToonerGUI : ShaderGUI {
BlendMode src_blend = BlendMode.One;
BlendMode dst_blend = BlendMode.Zero;
bool zwrite = false;
+ EditorGUI.EndChangeCheck();
+ RecordAction("Rendering mode");
- if (EditorGUI.EndChangeCheck()) {
- RecordAction("Rendering mode");
+ bc = FindProperty("_Render_Queue_Offset");
+ editor.IntegerProperty(
+ bc,
+ "Render queue offset");
+ int queue_offset = bc.intValue;
+
+ {
SetKeyword("_RENDERING_CUTOUT", mode == RenderingMode.Cutout);
SetKeyword("_RENDERING_FADE", mode == RenderingMode.Fade);
SetKeyword("_RENDERING_TRANSPARENT", mode == RenderingMode.Transparent);
@@ -1146,6 +1148,7 @@ public class ToonerGUI : ShaderGUI {
zwrite = true;
break;
}
+
foreach (Material m in editor.targets) {
m.renderQueue = ((int) queue) + queue_offset;
m.SetOverrideTag("RenderType", render_type);
@@ -1216,6 +1219,25 @@ public class ToonerGUI : ShaderGUI {
bc,
"Lighting multiplier");
+ {
+ EditorGUI.indentLevel += 1;
+ bc = FindProperty("_Direct_Lighting_Factor");
+ editor.RangeProperty(
+ bc,
+ "Direct multiplier");
+
+ bc = FindProperty("_Indirect_Specular_Lighting_Factor");
+ editor.RangeProperty(
+ bc,
+ "Indirect specular multiplier");
+
+ bc = FindProperty("_Indirect_Diffuse_Lighting_Factor");
+ editor.RangeProperty(
+ bc,
+ "Indirect diffuse multiplier");
+ EditorGUI.indentLevel -= 1;
+ }
+
bc = FindProperty("_Reflection_Probe_Saturation");
editor.RangeProperty(
bc,