From 760c3a2b4edc2ea0bf10344ff7592f176a2f92ff Mon Sep 17 00:00:00 2001 From: heck Date: Wed, 3 May 2023 02:22:52 +0200 Subject: [PATCH] some shader tweaks making the time go round and round --- html/index.html | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/html/index.html b/html/index.html index 571edc7..6a38d01 100644 --- a/html/index.html +++ b/html/index.html @@ -66,29 +66,30 @@ vec2 f = pos.xy - i; vec2 blend = f * f * (3.0 -(2.0 * f)); float noiseVal = - mix( - mix( - dot(GetGradient(i + vec2(0, 0), pos.z), f - vec2(0, 0)), - dot(GetGradient(i + vec2(1, 0), pos.z), f - vec2(1, 0)), - blend.x), - mix( - dot(GetGradient(i + vec2(0, 1), pos.z), f - vec2(0, 1)), - dot(GetGradient(i + vec2(1, 1), pos.z), f - vec2(1, 1)), - blend.x), - blend.y - ); - return noiseVal / 0.7;// normalize to about [-1..1] + mix( + mix( + dot(GetGradient(i + vec2(0, 0), pos.z), f - vec2(0, 0)), + dot(GetGradient(i + vec2(1, 0), pos.z), f - vec2(1, 0)), + blend.x), + mix( + dot(GetGradient(i + vec2(0, 1), pos.z), f - vec2(0, 1)), + dot(GetGradient(i + vec2(1, 1), pos.z), f - vec2(1, 1)), + blend.x), + blend.y + ); + return noiseVal / 0.7; } void mainImage(out vec4 fragColor, in vec2 fragCoord) { vec2 uv = fragCoord.xy / iResolution.y; - - float time = iTime * (iTime * 0.1); vec2 uvm = iMouse.xy / iResolution.y; - float noiseVal = 0.5 + 0.5 * Pseudo3dNoise(vec3(uv *6.0, time/10.)); + + float time = (80.-(1.*uvm.y)) * sin(iTime / 30000.); + + float noiseVal = 0.5 + 0.1 + (time/100.) * Pseudo3dNoise(vec3(uv * (6. + (0.07 * uvm.x)), time/10.)); float val = sin(noiseVal * time + (sin(time) * time / 10.)); - fragColor.rgba = vec4(val, val, val, 1.); + fragColor.rgba = vec4(vec3(val), 1.0); } void main() { @@ -99,8 +100,6 @@