Synthwave Run drives the song's protagonist instead of the same car
The grid, mountains and sun keep their palette-driven forms and are still individually switchable so the arc driver can strip the scene back to just the grid for a breakdown, but the car was the same silhouette in every video — a hexagonal track and a round track drove the same stepped rect with red discs. The thing on the road is now the song's own protagonist: the same solid every other stage in the video draws, seen here as one hero above the grid, turning slowly so its outline changes across the song rather than being one silhouette from every angle. One castSolid instance sized by stageScale() so a song of few huge forms drives a huge hero and a song of many small ones drives a small one, lit by castLit with an inkStroke rim and a soft ground ellipse for contact. Gated by the existing u_car param so a breakdown still drops to just the grid the same way it used to. Declares form, ink, staging and shape/space/camera/style (texture 0.4); the lint's backtick and consumes gates stay green. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
3a0cf26e6c
commit
c216e31413
@ -1,18 +1,23 @@
|
|||||||
// Ported from party-stage's "Synthwave Run".
|
// Ported from party-stage's "Synthwave Run".
|
||||||
//
|
//
|
||||||
// The original hardcoded magenta and cyan and drew a car silhouette with
|
// The original hardcoded magenta and cyan and drew a car silhouette with
|
||||||
// red taillights. The car is kept — it is the scene's whole identity — but the
|
// red taillights. The grid, mountains and sun keep their palette-driven
|
||||||
// colours now come from the palette, and the elements (grid, mountains, sun,
|
// forms and are individually switchable so the arc driver can strip the
|
||||||
// car) are individually switchable so the arc driver can strip it back to just
|
// scene back to just the grid for a breakdown, but the car is gone: it
|
||||||
// the grid during a breakdown and bring the rest in for the drop.
|
// was the same silhouette in every video, so a hexagonal track and a round
|
||||||
|
// track drove the same car. The thing on the road is now the song's own
|
||||||
|
// protagonist — the same solid every other stage in the video draws, seen
|
||||||
|
// here as a single hero turning slowly above the grid — so a hexagonal
|
||||||
|
// track drives a hexagonal form. See castSolid.
|
||||||
|
|
||||||
export const synthwaveRun = {
|
export const synthwaveRun = {
|
||||||
name: 'Synthwave Run',
|
name: 'Synthwave Run',
|
||||||
family: 'structural',
|
family: 'structural',
|
||||||
kind: 'fragment',
|
kind: 'fragment',
|
||||||
// Personality: see look/Personality.js.
|
// Personality: see look/Personality.js.
|
||||||
consumes: ['ink'],
|
texture: 0.4,
|
||||||
traits: ['space', 'camera', 'style'],
|
consumes: ['form', 'ink', 'staging'],
|
||||||
|
traits: ['shape', 'space', 'camera', 'style'],
|
||||||
|
|
||||||
params: {
|
params: {
|
||||||
speed: { type: 'float', range: [0.3, 4], default: 1.5, uniform: 'u_speed', bias: 'motion', rate: true },
|
speed: { type: 'float', range: [0.3, 4], default: 1.5, uniform: 'u_speed', bias: 'motion', rate: true },
|
||||||
@ -76,24 +81,36 @@ vec4 scene(vec2 uv, vec2 p) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- car silhouette ---
|
// --- protagonist on the road ---
|
||||||
|
// The same solid every other stage in this video draws, now as the hero
|
||||||
|
// the camera is chasing down the grid. One instance, turning slowly so
|
||||||
|
// its outline changes across the song rather than being the same
|
||||||
|
// silhouette from every angle. The car param now gates how present it
|
||||||
|
// is, so a breakdown can drop to just the grid the same way it used to.
|
||||||
if (u_car > 0.01) {
|
if (u_car > 0.01) {
|
||||||
vec2 carPos = vec2(sin(t * 0.1) * 0.2, -0.78 + sin(t * 30.0) * 0.001);
|
float bob = sin(t * 0.6) * 0.012 + sin(t * 1.7 + u_seed) * 0.006;
|
||||||
vec2 cp = p - carPos;
|
vec2 heroPos = vec2(sin(t * 0.08) * 0.18, -0.68 + bob);
|
||||||
float cpX = abs(cp.x);
|
float base = 0.32 * stageScale();
|
||||||
|
float size = base * (1.0 + beat * 0.18);
|
||||||
float body = step(cpX, 0.35) * step(abs(cp.y), 0.12);
|
vec2 local = (p - heroPos) / max(size, 1e-3);
|
||||||
float glass = step(cpX, 0.22) * step(abs(cp.y - 0.18), 0.07);
|
if (dot(local, local) < 1.7) {
|
||||||
float wingTop = step(cpX, 0.32) * step(abs(cp.y - 0.20), 0.025);
|
mat3 turn = castTurn(t * 0.35 + u_seed * 1.1, sin(t * 0.28 + u_seed * 0.7) * 0.55);
|
||||||
float wingSide = step(abs(cpX - 0.30), 0.03) * step(abs(cp.y - 0.12), 0.1);
|
vec3 n;
|
||||||
|
float hit = castSolid(local, turn, n);
|
||||||
if (body + glass + wingTop + wingSide > 0.0) {
|
if (hit > 0.0) {
|
||||||
col = mix(col, vec3(0.015), 0.95 * u_car);
|
vec3 lit = castLit(n, vec3(0.0, 0.0, 1.0));
|
||||||
float r = 0.025;
|
col = mix(col, lit, 0.92 * u_car);
|
||||||
float l1 = smoothstep(r, r * 0.6, length(vec2(cpX - 0.21, cp.y - 0.03)));
|
|
||||||
float l2 = smoothstep(r, r * 0.6, length(vec2(cpX - 0.29, cp.y - 0.03)));
|
|
||||||
col = mix(col, pal(2) * (0.6 + beat * 1.4), sat(l1 + l2) * u_car);
|
|
||||||
}
|
}
|
||||||
|
float d = castSDF3(turn * vec3(local, 0.0)) * size;
|
||||||
|
col += pal(2) * inkStroke(d) * 0.65 * u_car;
|
||||||
|
col += pal(1) * exp(-dot(local, local) * 1.2) * 0.08 * u_car;
|
||||||
|
}
|
||||||
|
// ground contact — a soft ellipse stretched along the grid, so the
|
||||||
|
// floating solid still reads as standing on something
|
||||||
|
vec2 shadowP = vec2((p.x - heroPos.x) / max(size * 1.4, 1e-3),
|
||||||
|
(p.y - heroPos.y + size * 0.45) / max(size * 0.22, 1e-3));
|
||||||
|
float shadow = exp(-dot(shadowP, shadowP)) * 0.35 * u_car * sat(1.0 - size * 0.8);
|
||||||
|
col = mix(col, vec3(0.0), shadow);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Horizon haze, scaled by the glow param.
|
// Horizon haze, scaled by the glow param.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user