fix electricity shader noise resetting every second

This commit is contained in:
Haze Weathers 2024-02-26 15:35:59 -05:00
parent f0a6cb49f3
commit 79294c0098

View file

@ -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(0.5 + sin(TIME * 20.0) * 0.1));
// tex_color.rgb = pow(tex_color.rgb, vec3(1.0 / 2.0)); // 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; // 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); n = step(abs(n), arc_threshold);
COLOR = vec4(mix(tex_color.rgb, arc_color.rgb, n * arc_color.a), tex_color.a); 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); // float worley = worley(SCREEN_UV, 128.0, 96.0);