summaryrefslogtreecommitdiff
path: root/src/effects
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-03-08 10:13:48 +0100
committerskal <pascal.massimino@gmail.com>2026-03-08 10:13:48 +0100
commitb717b3e0d8cc8e423a5b74bc7559b7280689d37f (patch)
tree50f6ff9202f94619372f81b4564aff96b9d15218 /src/effects
parentf90adb82e510a6d8ba98272c2352d24dd06a1997 (diff)
tweak: scene2.wgsl visual adjustments
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src/effects')
-rw-r--r--src/effects/scene2.wgsl24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/effects/scene2.wgsl b/src/effects/scene2.wgsl
index 7df91c3..3221321 100644
--- a/src/effects/scene2.wgsl
+++ b/src/effects/scene2.wgsl
@@ -8,30 +8,28 @@
@group(0) @binding(2) var<uniform> uniforms: UniformsSequenceParams;
fn N(a: vec3f, p: vec3f) -> f32 {
- return abs(dot(sin(uniforms.time + 0.1 * p.z + 0.3 * p / a), a + a));
+ return abs(dot(sin(uniforms.time + 0.1 * p.z + 0.6 * p / a), a));
}
@fragment fn fs_main(in: VertexOutput) -> @location(0) vec4f {
let r = uniforms.resolution;
- let frag_coord = vec2f(in.position.x, r.y - in.position.y);
- let u = (frag_coord + frag_coord - r) / r.y;
+ let uv = in.position.xy;
+ let u = (2. * uv - r.xy) / r.y;
var p = vec3f(0.0);
- var col = vec4f(0.0);
- var s: f32 = 0.0;
-
+ var col = vec3f(0.0);
for (var i: f32 = 0.0; i < 100.0; i += 1.0) {
- p += vec3f(u * s, s);
- s = 6.0 + p.y;
- s -= N(vec3f(0.08), p);
- s -= N(vec3f(0.2), p);
- s -= N(vec3f(0.6), p);
+ var s = 6.0 + p.y;
+ s -= N(vec3f(0.15), p);
+ s -= N(vec3f(0.5), p);
+ s -= N(vec3f(1.2), p);
s = 0.1 + abs(s) * 0.2;
- col += vec4f(4.0, 2.0, 1.0, 0.0) / s;
+ col += vec3f(3.0, 2.0, 1.0) / s;
+ p += vec3f(u * s, s);
}
col *= smoothstep(0.8, 0.75, abs(u.y));
let len_u = max(length(u), 0.0001);
col = tanh(col / 2000.0 / len_u);
- return vec4f(col.rgb, 1.0);
+ return vec4f(col, 1.0);
}