reduce shader time rollover to 240 seconds and alter shaders to accomodate (closes #198)

This commit is contained in:
Haze Weathers 2023-10-14 17:06:41 -04:00
parent bd12aa68c1
commit 9c507a9b4f
8 changed files with 17 additions and 11 deletions

View file

@ -1,12 +1,14 @@
shader_type canvas_item;
const float TAU = 6.28319;
uniform float arc_speed = 4.0;
uniform float arc_fps = 10.0;
uniform float arc_scale = 8.0;
uniform float arc_threshold = 0.15;
uniform vec4 arc_color : hint_color = vec4(1.0, 0.93, 0.0, 1.0);
uniform float gamma = 2.0;
uniform float flash_rate = 20.0;
uniform float flash_rate = 3.0;
uniform float flash_intensity = 0.2;
// Description : Array and textureless GLSL 2D/3D/4D simplex
@ -115,11 +117,11 @@ void fragment() {
COLOR = vec4(1.0, 1.0, 1.0, COLOR.a);
} else {
vec4 tex_color = texture(TEXTURE, UV);
tex_color.rgb = pow(tex_color.rgb, vec3(1.0 / (gamma + sin(TIME * flash_rate) * flash_intensity)));
tex_color.rgb = pow(tex_color.rgb, vec3(1.0 / (gamma + sin(fract(TIME * floor(flash_rate)) * TAU) * flash_intensity)));
// 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(TIME * arc_fps) * arc_speed / arc_fps));
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);