Aero Bubbles

của MusicBar, thanh tiến trình

Thanh kính xanh aqua bóng loáng kiểu đầu những năm 2000 đầy dần tới chỗ đang phát, bên trong là trời xanh với đồi cỏ, bong bóng xà phòng ánh cầu vồng bay lên giữa mấy chiếc lá non, tới nhịp là bong bóng nổ tách tách.

1 lượt tải Tải file, 8.6 KB
Cách cài, mã SHA-256 và mã nguồn

Bấm Áp dụng: MusicBar tự tải về, kiểm tra mã SHA-256 rồi mặc lên taskbar; có rồi thì mặc luôn. Cần MusicBar 1.8 trở lên.

SHA-256 a127bb1560ddf4f048bc9a13b6e3696c53da32bd052cf90efdcde4817ba57cc3

//! name: Aero Bubbles
//! author: MusicBar
//! kind: progress
//! description: A glossy aqua pill fills to the playhead with a sunny sky over green hills, soap bubbles in rainbow film rise inside and pop on the beat, and a glass globe leads the way.

float hash1(float n) { n = frac(n * 0.1031); n *= n + 33.33; n *= n + n; return frac(n); }

// Lays a color over what is there (premultiplied light, and how much of the pixel it covers).
void layer(inout float3 acc, inout float cover, float3 rgb, float a)
{
    a = saturate(a);
    acc = rgb * a + acc * (1.0 - a);
    cover = a + cover * (1.0 - a);
}

float2 rot(float2 p, float a) { float c = cos(a), s = sin(a); return float2(c * p.x - s * p.y, s * p.x + c * p.y); }

// Soap film: the colors cycle with the film's thickness t.
float3 film(float t) { return 0.55 + 0.45 * cos(6.2832 * (t + float3(0.0, 0.33, 0.67))); }

// The little world inside the glass: a sky that deepens upward, a sun glow, two rolling hills.
// v runs -1 (bottom of the glass) to 1 (top), hx is the position along the bar in bar heights.
float3 world(float v, float hx, float sp, float2 sun, float r)
{
    float3 sky = lerp(lerp(colorA.rgb, float3(1, 1, 1), 0.6), colorA.rgb * 0.75, saturate(v * 0.8 + 0.3));
    sky += colorC.rgb * 0.55 * exp(-length(sun / float2(1.4, 0.55)));
    float hb = -0.02 + 0.2 * sin(hx * 0.8 + 1.3) + 0.08 * sin(hx * 1.9 + 0.5);
    float hf = -0.42 + 0.16 * sin(hx * 1.25 + 0.4) + 0.08 * sin(hx * 2.9 + 2.0) + 0.25 * sp;
    float3 farHill = lerp(lerp(colorB.rgb, colorA.rgb, 0.45), float3(1, 1, 1), 0.25 - 0.4 * (hb - v));
    float3 nearHill = colorB.rgb * lerp(1.15, 0.5, saturate((hf - v) * 1.2)) + 0.12;
    float3 c = lerp(sky, farHill, smoothstep(-0.6, 0.6, (hb - v) * r));
    c = lerp(c, nearHill, smoothstep(-0.6, 0.6, (hf - v) * r));
    return c + lerp(colorB.rgb, float3(1, 1, 1), 0.6) * 0.5 * smoothstep(1.2, 0.0, abs((hf - v) * r - 0.8));
}

float4 main(float2 uv : TEXCOORD) : COLOR
{
    float u = size.y;
    float2 px = float2(uv.x * size.x, (1.0 - uv.y) * u);     // pixels, y up the screen so bubbles always rise
    float r = 0.29 * u, cy = 0.5 * u;
    float x0 = 0.45 * u, x1 = size.x - 0.45 * u;
    float head = clamp(progress * size.x, x0, x1);
    float sp = spectrum(abs(uv.x - 0.5) * 2.0);
    float3 acc = float3(0, 0, 0);
    float cover = 0;

    // The empty track ahead: faint clear glass with a thin rim.
    float dTrack = length(px - float2(clamp(px.x, x0, x1), cy)) - r;
    layer(acc, cover, float3(0.85, 0.95, 1.0), smoothstep(0.5, -0.5, dTrack) * 0.08);
    layer(acc, cover, lerp(colorA.rgb, float3(1, 1, 1), 0.4), smoothstep(1.0, 0.0, abs(dTrack + 0.5)) * 0.45);

    // The filled pill: an aqua halo, then the world inside the glass.
    float dPill = length(px - float2(clamp(px.x, x0, head), cy)) - r;
    float pill = smoothstep(0.5, -0.5, dPill);
    float v = (px.y - cy) / r;
    layer(acc, cover, colorA.rgb, exp(-max(dPill, 0.0) / (0.1 * u)) * (0.3 + 0.25 * level + 0.3 * beat));
    float3 inside = world(v, px.x / u, sp, (px - float2(head - 1.3 * u, cy + 0.5 * r)) / u, r);
    inside += float3(0.7, 0.95, 1.0) * 0.45 * exp(-(v + 1.0) * 5.0);       // light gathering at the bottom of the glass
    layer(acc, cover, inside, pill);

    // The glass gloss: a big soft highlight over the upper half (bubbles and leaves float in front of it).
    float dGloss = length((px - float2(clamp(px.x, x0 + 0.25 * r, head - 0.25 * r), cy + 0.5 * r)) / float2(1.0, 0.95)) - 0.4 * r;
    layer(acc, cover, float3(1, 1, 1), smoothstep(0.5, -0.5, dGloss) * lerp(0.0, 0.55, smoothstep(0.05, 0.9, v)));

    // Leaves drifting through, slowly turning: two-tone halves, a pale midrib, a stem and a shine.
    float lc = floor(px.x / (2.7 * u));
    float lh = hash1(lc * 3.7 + 11.0);
    float2 lq = rot(px - float2((lc + 0.25 + 0.5 * lh) * 2.7 * u + 0.15 * u * sin(time * 0.7 + lh * 6.0), cy + r * (0.1 + 0.25 * sin(time * 0.9 + lh * 9.0))), lh * 6.0 + 0.5 * sin(time * 1.1 + lh * 4.0)) / u;
    float lx = saturate(lq.x / 0.36 + 0.5);
    float lw = 0.085 * sqrt(saturate(lx * (1.0 - lx) * 4.0)) * (1.15 - 0.4 * lx);
    float dLeaf = max(abs(lq.y + 0.02 * sin(lx * 3.14)) - lw, abs(lq.x) - 0.18) * u;
    dLeaf = min(dLeaf, max(abs(lq.y - 0.01 * (lq.x + 0.18) / 0.06) - 0.012, abs(lq.x + 0.21) - 0.03) * u);
    float3 leafC = lerp(colorB.rgb * 0.85, lerp(colorB.rgb, float3(1.0, 1.0, 0.55), 0.45), step(0.0, lq.y));
    leafC = lerp(leafC, lerp(colorB.rgb, float3(1, 1, 0.8), 0.7), smoothstep(0.9, 0.2, abs(lq.y) * u) * step(abs(lq.x), 0.15));
    leafC += 0.5 * smoothstep(0.5, -0.5, length((lq - float2(0.03, 0.035)) * u / float2(2.2, 1.0)) - 0.025 * u);
    float hasLeaf = step(0.4, lh) * pill;
    layer(acc, cover, colorB.rgb * 0.2, smoothstep(0.5, -0.5, dLeaf - 0.9) * hasLeaf * 0.8);
    layer(acc, cover, leafC, smoothstep(0.5, -0.5, dLeaf) * hasLeaf);

    // Soap bubbles rising through the glass, one per cell; a pixel checks its own cell and both neighbors.
    float cw = 0.42 * u;
    float ci = floor(px.x / cw);
    for (int k = -1; k <= 1; k++)
    {
        float c = ci + k;
        float h = hash1(c * 1.31 + 2.0), h2 = hash1(c * 7.17 + 5.0), h3 = hash1(c * 3.9 + 8.0);
        float br = (0.065 + 0.075 * h2) * u;
        float life = frac(time * (0.24 + 0.12 * h) + h3 * 5.0);
        float2 bc = float2((c + 0.5) * cw + 0.1 * u * sin(time * 2.0 + h * 9.0), cy - r - br + life * (2.0 * r + 2.0 * br));
        float2 d = px - bc;
        float dl = length(d);
        float ang = atan2(d.y, d.x);
        float on = step(0.15, h) * step(bc.x, head - br);
        float pops = on * step(0.5, h3) * smoothstep(0.0, 0.08, beat);
        float t = 1.0 - beat;

        // A whole bubble: clear middle, rainbow film at the rim, a window highlight and a small bounce light.
        float3 fc = film(ang * 0.16 + dl / br * 0.5 + time * 0.25 + h * 3.0);
        float body = smoothstep(0.5, -0.5, dl - br) * on * (1.0 - pops) * pill;
        layer(acc, cover, colorA.rgb * 0.35, smoothstep(1.2, 0.0, abs(dl - br - 0.4)) * on * (1.0 - pops) * pill * 0.45);
        layer(acc, cover, lerp(fc, float3(1, 1, 1), 0.15), body * (0.1 + 0.85 * smoothstep(br * 0.5, br, dl)));
        layer(acc, cover, float3(1, 1, 1), body * smoothstep(0.5, -0.5, length(d - br * float2(-0.38, 0.38)) - br * 0.24));
        layer(acc, cover, float3(1, 1, 1), body * 0.6 * smoothstep(0.5, -0.5, length(d - br * float2(0.42, -0.4)) - br * 0.1));

        // The pop: a broken ring flying out and a spray of droplets.
        float ring = smoothstep(0.6 + 0.12 * br, 0.0, abs(dl - br * (1.0 + 1.2 * t))) * step(0.4, frac(ang / 6.2832 * 6.0 + h));
        float sector = (floor(ang / 6.2832 * 8.0) + 0.5) * 6.2832 / 8.0;
        float drop = smoothstep(0.5, -0.5, length(d - float2(cos(sector), sin(sector)) * br * (1.1 + 2.0 * t)) - max(0.9, 0.2 * br * (0.4 + 0.6 * beat)));
        layer(acc, cover, float3(1, 1, 1), pops * beat * beat * beat * smoothstep(br, 0.0, dl) * 0.8);
        layer(acc, cover, lerp(film(ang * 0.16 + h), float3(1, 1, 1), 0.35), pops * saturate(beat * 1.6) * (ring + drop));
    }

    // The glass edge: a thin top shine and a dark rim so it holds on light taskbars.
    layer(acc, cover, float3(1, 1, 1), smoothstep(1.0, 0.0, abs(dPill + 1.6)) * smoothstep(0.3, 0.8, v) * 0.5);
    layer(acc, cover, lerp(colorA.rgb, float3(0.0, 0.1, 0.25), 0.6), smoothstep(1.0, 0.1, abs(dPill + 0.3)) * 0.85);

    // The globe at the playhead: a tiny world in clear glass that swells on the beat.
    float R = 0.42 * u * (1.0 + 0.08 * beat);
    float2 g = (px - float2(head, cy)) / R;
    float gd = (length(g) - 1.0) * R;
    float3 gw = world(g.y * 1.3 - 0.1, (head + g.x * R * 0.6) / u, sp, float2(g.x + 0.45, g.y - 0.35) * 1.3, R);
    gw = lerp(gw, colorA.rgb * 0.45, smoothstep(0.6, 1.0, length(g)) * 0.6);           // the glass thickens at the edge
    gw += float3(0.75, 0.95, 1.0) * 0.55 * smoothstep(0.35, 1.0, -g.y) * smoothstep(1.0, 0.8, length(g));
    layer(acc, cover, lerp(colorA.rgb, colorC.rgb, 0.3), exp(-max(gd, 0.0) / (0.12 * u)) * (0.35 + 0.3 * level + 0.5 * beat));
    layer(acc, cover, gw, smoothstep(0.5, -0.5, gd));
    float dCap = length((g - float2(0.0, 0.42)) / float2(0.78, 0.5)) - 1.0;
    layer(acc, cover, float3(1, 1, 1), smoothstep(0.04, -0.04, dCap) * lerp(0.1, 0.85, saturate(g.y * 1.3 - 0.05)));
    layer(acc, cover, float3(1, 1, 1), smoothstep(0.5, -0.5, length(g - float2(0.48, -0.52)) * R - 0.1 * R) * 0.7);
    layer(acc, cover, lerp(colorA.rgb, float3(0.0, 0.1, 0.25), 0.55), smoothstep(1.0, 0.1, abs(gd + 0.3)) * 0.9);

    // A beat ring rolling out of the globe.
    layer(acc, cover, lerp(colorA.rgb, float3(1, 1, 1), 0.6), smoothstep(1.2, 0.0, abs(length(px - float2(head, cy)) - R * (1.0 + 0.9 * (1.0 - beat)))) * beat * 0.8);

    return paint(acc / max(cover, 0.001), cover);
}