From 79294c0098e7011f1b7ca353d575710bf3bebd14 Mon Sep 17 00:00:00 2001 From: Haze Weathers Date: Mon, 26 Feb 2024 15:35:59 -0500 Subject: [PATCH] fix electricity shader noise resetting every second --- shaders/electricity.gdshader | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shaders/electricity.gdshader b/shaders/electricity.gdshader index 9ea7890..9f236b4 100644 --- a/shaders/electricity.gdshader +++ b/shaders/electricity.gdshader @@ -121,7 +121,8 @@ void fragment() { // tex_color.rgb = pow(tex_color.rgb, vec3(0.5 + sin(TIME * 20.0) * 0.1)); // tex_color.rgb = pow(tex_color.rgb, vec3(1.0 / 2.0)); // tex_color.rgb += (round(sin(TIME * 20.0) * 4.0)) * 0.25 * 0.05; - float n = snoise(vec3(SCREEN_UV / SCREEN_PIXEL_SIZE / arc_scale, floor(fract(TIME) * arc_fps) * arc_speed / arc_fps)); + float n = snoise(vec3(SCREEN_UV / SCREEN_PIXEL_SIZE / arc_scale, (floor(TIME) + (floor(fract(TIME) * arc_fps)) / arc_fps) * arc_speed)); +// float n = snoise(vec3(SCREEN_UV / SCREEN_PIXEL_SIZE / arc_scale, floor(fract(TIME) * arc_fps) * arc_speed / arc_fps)); n = step(abs(n), arc_threshold); COLOR = vec4(mix(tex_color.rgb, arc_color.rgb, n * arc_color.a), tex_color.a); // float worley = worley(SCREEN_UV, 128.0, 96.0);