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,5 +1,7 @@
shader_type canvas_item;
const float TAU = 6.28319;
uniform float speed = 1.0;
uniform float cycle_offset = 0.0;
uniform float wave_length = 1.0;
@ -11,6 +13,7 @@ float plot(vec2 st, float pct) {
}
void fragment() {
float x = sin(UV.y * wave_length + TIME * speed + cycle_offset)*0.5+0.5;
float sin_time = fract(TIME * floor(speed)) * TAU;
float x = sin(UV.y * wave_length + sin_time + cycle_offset)*0.5+0.5;
COLOR = COLOR * vec4(1.0, 1.0, 1.0, plot(UV * vec2(1.2, 1.0) + vec2(-0.1, 0.0), x));
}