summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Editor/tooner.cs5
-rw-r--r--atrix256.cginc4
-rw-r--r--globals.cginc3
-rw-r--r--tooner.shader2
-rw-r--r--tooner_lighting.cginc3
5 files changed, 14 insertions, 3 deletions
diff --git a/Editor/tooner.cs b/Editor/tooner.cs
index 3a158c8..3453e4d 100644
--- a/Editor/tooner.cs
+++ b/Editor/tooner.cs
@@ -2518,10 +2518,15 @@ public class ToonerGUI : ShaderGUI {
} else if (cmode == CutoutMode.InterleavedGradientNoise) {
bc = FindProperty("_Rendering_Cutout_Ign_Seed");
FloatProperty(bc, "Seed");
+ bc = FindProperty("_Rendering_Cutout_Ign_Speed");
+ FloatProperty(bc, "Speed");
}
EditorGUI.indentLevel -= 1;
}
+ bc = FindProperty("_Frame_Counter");
+ FloatProperty(bc, "Frame counter");
+
bc = FindProperty("_Cull");
UnityEngine.Rendering.CullMode cull_mode = (UnityEngine.Rendering.CullMode) bc.floatValue;
EditorGUI.BeginChangeCheck();
diff --git a/atrix256.cginc b/atrix256.cginc
index 3eb164c..ccdc750 100644
--- a/atrix256.cginc
+++ b/atrix256.cginc
@@ -33,8 +33,8 @@ float ign(float2 screen_px) {
0.00583715 * screen_px.y, 1), 1);
}
-float ign_anim(float2 screen_px) {
- float frame = frac(_Time[0]*.0005) * 64;
+float ign_anim(float2 screen_px, float frame, float speed) {
+ frame = fmod(frame * speed, 64);
return ign(screen_px + frame * 5.588238f);
}
diff --git a/globals.cginc b/globals.cginc
index b5b2160..a038a05 100644
--- a/globals.cginc
+++ b/globals.cginc
@@ -37,6 +37,8 @@ float _Reflection_Probe_Saturation;
float _Min_Brightness;
float _Max_Brightness;
+float _Frame_Counter;
+
float _Mesh_Normals_Mode;
float _Flatten_Mesh_Normals_Str;
float _Confabulate_Normals;
@@ -320,6 +322,7 @@ float _Ambient_Occlusion_Strength;
float _Alpha_Cutoff;
#if defined(_RENDERING_CUTOUT_IGN)
float _Rendering_Cutout_Ign_Seed;
+float _Rendering_Cutout_Ign_Speed;
#endif
#endif
diff --git a/tooner.shader b/tooner.shader
index 44cac77..8f895c7 100644
--- a/tooner.shader
+++ b/tooner.shader
@@ -207,6 +207,8 @@ Shader "yum_food/tooner"
_Alpha_Cutoff("Alpha cutoff", Range(0, 1)) = 0.5
_Rendering_Cutout_Ign_Seed("IGN seed", Float) = 0
+ _Rendering_Cutout_Ign_Speed("IGN speed", Float) = 0.00001
+ _Frame_Counter("Frame counter", Float) = 0
_Outline_Width("Outline width", Range(0, 0.1)) = 0.01
_Outline_Color("Outline color", Color) = (0, 0, 0, 1)
diff --git a/tooner_lighting.cginc b/tooner_lighting.cginc
index cfe8f32..8c183ae 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(tdata.screen_uv_round + _Rendering_Cutout_Ign_Seed,
+ floor(_Frame_Counter), _Rendering_Cutout_Ign_Speed);
clip(albedo.a - ar);
#elif defined(_RENDERING_CUTOUT_NOISE_MASK)
float ar = _Rendering_Cutout_Noise_Mask.SampleLevel(point_repeat_s, tdata.screen_uv * _ScreenParams.xy * _Rendering_Cutout_Noise_Mask_TexelSize.xy, 0);