summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2024-11-30 16:46:41 -0800
committeryum <yum.food.vr@gmail.com>2024-11-30 16:46:41 -0800
commit8232f195185d7550c331a78ed57b1a44746d294b (patch)
treec0b93d06a643b7ab0d8d66eb951291e2b643ce78
parent10609e0207123ad8fb20cf578672b95f8c7ad1d6 (diff)
Add cutout noise scale slider
-rw-r--r--Editor/tooner.cs3
-rw-r--r--globals.cginc1
-rw-r--r--tooner.shader1
-rw-r--r--tooner_lighting.cginc3
4 files changed, 7 insertions, 1 deletions
diff --git a/Editor/tooner.cs b/Editor/tooner.cs
index 3453e4d..e9ba50e 100644
--- a/Editor/tooner.cs
+++ b/Editor/tooner.cs
@@ -2524,6 +2524,9 @@ public class ToonerGUI : ShaderGUI {
EditorGUI.indentLevel -= 1;
}
+ bc = FindProperty("_Rendering_Cutout_Noise_Scale");
+ FloatProperty(bc, "Cutout noise scale");
+
bc = FindProperty("_Frame_Counter");
FloatProperty(bc, "Frame counter");
diff --git a/globals.cginc b/globals.cginc
index a038a05..45d2b58 100644
--- a/globals.cginc
+++ b/globals.cginc
@@ -38,6 +38,7 @@ float _Min_Brightness;
float _Max_Brightness;
float _Frame_Counter;
+float _Rendering_Cutout_Noise_Scale;
float _Mesh_Normals_Mode;
float _Flatten_Mesh_Normals_Str;
diff --git a/tooner.shader b/tooner.shader
index 8f895c7..91dffec 100644
--- a/tooner.shader
+++ b/tooner.shader
@@ -206,6 +206,7 @@ Shader "yum_food/tooner"
[MaterialToggle] _Confabulate_Normals("Confabulate mesh normals", Float) = 0.0
_Alpha_Cutoff("Alpha cutoff", Range(0, 1)) = 0.5
+ _Rendering_Cutout_Noise_Scale("Noise scale", Float) = 1
_Rendering_Cutout_Ign_Seed("IGN seed", Float) = 0
_Rendering_Cutout_Ign_Speed("IGN speed", Float) = 0.00001
_Frame_Counter("Frame counter", Float) = 0
diff --git a/tooner_lighting.cginc b/tooner_lighting.cginc
index 8c183ae..45de66c 100644
--- a/tooner_lighting.cginc
+++ b/tooner_lighting.cginc
@@ -1798,7 +1798,8 @@ float4 effect(inout v2f i, out float depth)
float ar = rand2(i.uv0);
clip(albedo.a - ar);
#elif defined(_RENDERING_CUTOUT_IGN)
- float ar = ign_anim(tdata.screen_uv_round + _Rendering_Cutout_Ign_Seed,
+ float ar = ign_anim(
+ floor(tdata.screen_uv_round * _Rendering_Cutout_Noise_Scale) + _Rendering_Cutout_Ign_Seed,
floor(_Frame_Counter), _Rendering_Cutout_Ign_Speed);
clip(albedo.a - ar);
#elif defined(_RENDERING_CUTOUT_NOISE_MASK)