Dadelion

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

Bồ công anh bay

140 lượt tải Tải file, 17.5 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 4d85714e7fae0efd242c8b105cd5229e96891707021f27a277db8a0db25e44e3

//! name: Tanpopo no Kaze (Bồ Công Anh)
//! author: Antigravity
//! kind: progress
//! description: Hoa bồ công anh lớn đung đưa êm ái ở đầu phát, thả những cánh dù trắng và ánh sao lấp lánh bay mượt qua toàn bộ taskbar

float hash11(float n)
{
    return frac(sin(n * 127.1 + 31.7) * 43758.5453);
}

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

// Miniature anime dandelion parachute seed:
// returns x = white silky pappus + stalk mask, y = warm amber seed grain mask.
float2 dandelionSeed(float2 q, float sc, float openAmt)
{
    float invSc = 1.0 / max(sc, 0.38);

    // Graceful botanical curve along the slender stalk (-5.4 up to +1.3)
    float sy = clamp(q.y, -5.4, 1.3);
    float syCurve = 0.030 * (sy - 1.3) * (sy - 1.3);
    float dStalk = length(float2(q.x - syCurve, q.y - sy));
    float stalk = smoothstep(0.55 * invSc, 0.06 * invSc, dStalk) * 0.78;

    // Tiny teardrop seed grain hanging at the bottom (-5.9)
    float grainX = 0.030 * 51.84;
    float2 gp = float2((q.x - grainX) * 1.24, (q.y + 5.9) * 0.58);
    float grain = smoothstep(1.04 * invSc + 0.30, 0.15, length(gp));

    // Feathery parachute crown fanning upward from hub (0, 1.1)
    float2 u = q - float2(0.0, 1.1);
    float r = length(u);
    float safeY = u.y + (u.y >= 0.0 ? 0.0001 : -0.0001);
    float ang = atan2(u.x, safeY);

    float fanSpan = 1.22 + 0.08 * openAmt;
    float dirSign = ang >= 0.0 ? 1.0 : -1.0;
    float curvedAng = ang - 0.032 * r * dirSign;
    float maxR = 7.5 * (1.0 - 0.11 * ang * ang);

    float inCrown = smoothstep(fanSpan, fanSpan - 0.18, abs(ang))
                  * smoothstep(maxR + 0.65, maxR - 0.90, r)
                  * smoothstep(0.15, 0.90, r);

    // 7 crisp silky filaments + soft cottony backlit aura + luminous filament tips
    float dRay = r * abs(sin(curvedAng * 7.5)) / 7.5;
    float rays = smoothstep(0.52 * invSc, 0.05 * invSc, dRay) * inCrown * 0.92;
    float tips = smoothstep(0.76 * invSc, 0.08 * invSc, dRay)
               * exp(-abs(r - maxR + 0.35) * 2.1)
               * smoothstep(fanSpan, fanSpan - 0.12, abs(ang)) * 0.86;
    float downGlow = exp(-length(u - float2(0.0, 3.9)) / 3.3) * 0.44;
    float hubDot = smoothstep(0.92 * invSc, 0.12, length(q - float2(0.0, 1.3))) * 0.88;

    float silk = saturate(rays + tips + downGlow + stalk + hubDot);
    return float2(silk, grain);
}

// Evaluates one silky-smooth parallax wind layer of drifting dandelion seeds.
// Pure continuous functions of time for position & angle (zero audio jitter/teleport!).
void evalSeedLayer(
    float2 p, float barScale, float cellW, float margin, float speed, float layerSeed,
    float minScale, float maxScale, float baseAlpha,
    float2 hub, float hasProg, float audioGlow,
    float3 skyTone, float3 sakura, float3 sunGold, float3 ivory, float3 seedAmber,
    inout float3 col, inout float alpha)
{
    float scrollX = p.x - time * speed;
    float cid = floor(scrollX / cellW);

    float h1 = hash11(cid * 4.31 + layerSeed);
    float h2 = hash11(cid * 8.79 + layerSeed * 1.7);
    float h3 = hash11(cid * 15.1 + layerSeed * 2.3);

    // Smooth, unhurried sine-wave gliding (never jumps on beat/spectrum!)
    float roamX = max(cellW * 0.5 - margin, 1.0);
    float sx = (cid + 0.5) * cellW + time * speed
             + roamX * 0.92 * sin(time * (0.65 + 0.45 * h2) + h1 * 6.283);
    float sy = 24.5 + 14.5 * sin(time * (0.75 + 0.45 * h3) + h2 * 6.283)
                    + 3.5 * cos(time * 1.35 + h1 * 6.283);

    // Plume density: rich stream blowing rightward from the big flower, gentle stream across the rest
    float ahead = sx - hub.x;
    float density = ahead >= 0.0
        ? lerp(0.24, 0.95, exp(-ahead / 280.0))
        : lerp(0.56, 0.24, exp(ahead / 45.0));
    density = lerp(0.72, density, hasProg);
    float spawn = smoothstep(h3 - 0.04, h3 + 0.04, density) * smoothstep(22.0, 34.0, length(float2(sx, sy) - hub));

    float sScale = lerp(minScale, maxScale, h1);
    float baseTilt = lerp(0.18, 0.88, h1 * 0.65 + h3 * 0.35);
    float tilt = baseTilt + 0.24 * sin(time * (1.25 + 0.65 * h2) + h2 * 6.283);

    float2 delta = p - float2(sx, sy);
    float2 sq = rot2d(delta, tilt) / sScale;
    if (dot(sq, sq) < 105.0 && spawn > 0.01)
    {
        float breath = 0.5 + 0.5 * sin(time * 1.8 + h1 * 6.283);
        float2 sg = dandelionSeed(sq, sScale * barScale, breath);

        // Music reacts via soft luminous halo shimmer, never jerky position jumps
        float haloFade = smoothstep(105.0, 50.0, dot(sq, sq));
        float seedHalo = exp(-length(delta) / (7.5 * sScale)) * haloFade * (0.14 + 0.14 * audioGlow) * spawn * baseAlpha;
        float3 tint = lerp(skyTone, lerp(sakura, sunGold, h1 * 0.6), h2);
        col += tint * seedHalo;
        alpha = saturate(alpha + seedHalo * 0.7);

        float sSilk = sg.x * spawn * baseAlpha;
        float sGrain = sg.y * spawn * baseAlpha;
        float3 sCol = lerp(tint, ivory, 0.84);
        col = lerp(col, sCol, sSilk);
        col = lerp(col, seedAmber, sGrain);
        alpha = max(alpha, max(sSilk, sGrain));
    }
}

float4 main(float2 uv : TEXCOORD) : COLOR
{
    // Sample audio up front for smooth glow/shimmer modulation (never used to jerk positions!)
    float bass = spectrum(0.08);
    float midFreq = spectrum(0.35);
    float highFreq = spectrum(0.72);
    float waveA = wave(uv.x);
    float audioGlow = saturate(0.55 * level + 0.45 * beat);

    // Normalized 48px-tall isotropic pixel coordinates (ground = 0, sky = 48)
    float h = rise(uv);
    float barScale = max(size.y / 48.0, 0.45);
    float2 p = float2(uv.x * size.x, h * size.y) / barScale;
    float barW = size.x / barScale;

    // Vibrant anime sunset / sakura / summer-sky palette harmonized with song colors
    float3 ivory = float3(1.0, 0.99, 0.96);
    float3 sakura = lerp(colorA.rgb, float3(1.0, 0.68, 0.86), 0.38);
    float3 skyTone = lerp(colorB.rgb, float3(0.38, 0.76, 1.0), 0.34);
    float3 sunGold = lerp(colorC.rgb, float3(1.0, 0.87, 0.52), 0.48);
    float3 meadow = lerp(float3(0.34, 0.82, 0.58), skyTone, 0.36);
    float3 seedAmber = lerp(float3(0.88, 0.68, 0.42), sunGold, 0.38);

    // Playhead position (kept comfortably inside edges so the 50%-larger flower never clips)
    float hasProg = step(0.002, progress);
    float headU = lerp(0.14, clamp(progress, 0.032, 0.968), hasProg);
    float headX = headU * barW;
    float playedMask = smoothstep(headX + 6.0, headX - 18.0, p.x);

    float3 col = float3(0.0, 0.0, 0.0);
    float alpha = 0.0;

    // 1. Anime Progress Meadow (0 -> headX): golden-sakura twilight horizon + sunlit ground line
    float horizonGrad = exp(-p.y / 12.0) * (0.42 + 0.20 * level) * lerp(0.05, 1.0, playedMask);
    float rimLine = exp(-p.y / 2.3) * (0.50 + 0.26 * beat) * playedMask;
    float komorebi = pow(0.5 + 0.5 * sin(p.x * 0.024 + p.y * 0.065 - time * 0.40), 3.0);
    komorebi *= exp(-abs(p.x - headX * 0.75) / (max(headX, 90.0) * 0.85)) * playedMask * smoothstep(0.0, 22.0, p.y) * 0.24;

    float3 meadowSky = lerp(skyTone, sakura, saturate(p.x / max(headX, 1.0)));
    col += meadowSky * horizonGrad + lerp(sakura, sunGold, 0.6) * rimLine + sunGold * komorebi;
    alpha = saturate(horizonGrad + rimLine * 0.65 + komorebi);

    // Smoothly swaying anime meadow grass along the played bottom edge (pure smooth time sway!)
    float grassCell = floor(p.x / 5.2);
    float gx = frac(p.x / 5.2) - 0.5;
    float gh = (4.2 + 5.8 * hash11(grassCell * 1.73)) * playedMask;
    float gBend = p.y / max(gh, 1.0);
    float gSway = gBend * gBend * (0.26 + 0.16 * sin(time * 2.0 - grassCell * 0.32));
    float blade = smoothstep(0.21, 0.03, abs(gx - gSway) + gBend * 0.09) * smoothstep(gh, gh * 0.25, p.y) * playedMask;
    float3 grassCol = lerp(meadow * 0.75, sunGold, gBend * 0.55 + 0.15 * beat);
    col = lerp(col, grassCol, blade * 0.68);
    alpha = max(alpha, blade * 0.60);

    // 2. Silky Makoto Shinkai Wind Ribbons (smooth gliding trajectories; audio modulates glow & shimmer)
    float windBehind = smoothstep(0.0, 28.0, p.x) * smoothstep(headX + 260.0, headX - 20.0, p.x);
    float windStream = exp(-max(p.x - headX, 0.0) / 220.0) * smoothstep(headX - 200.0, headX, p.x);
    float windEnv = max(windBehind * 0.85, windStream);

    float ribbon1Y = 18.0 + 7.2 * sin(p.x * 0.014 - time * 1.85) + 2.4 * cos(p.x * 0.031 - time * 2.7);
    float ribbon2Y = 30.0 + 6.4 * cos(p.x * 0.017 - time * 1.45 + 1.9) + 2.0 * sin(p.x * 0.027 - time * 2.2);
    float ribWidth1 = 1.45 * (1.0 + 0.28 * abs(waveA) * level);
    float rib1 = exp(-abs(p.y - ribbon1Y) / ribWidth1) * windEnv * (0.30 + 0.28 * level + 0.12 * beat);
    float rib2 = exp(-abs(p.y - ribbon2Y) / 1.25) * windEnv * (0.22 + 0.24 * highFreq);
    col += lerp(sakura, ivory, 0.48) * rib1 + lerp(skyTone, sunGold, 0.48) * rib2;
    alpha = saturate(alpha + rib1 * 0.70 + rib2 * 0.60);

    // 3. Dreamy Anime Bokeh Orbs + Kirakira 4-Point Star Sparkles + Smooth Tumbling Sakura Petals
    float bCellW = 48.0;
    float bid = floor((p.x - time * 9.5) / bCellW);
    float bh1 = hash11(bid * 3.17 + 9.1);
    float bh2 = hash11(bid * 7.31 + 2.4);
    float bx = (bid + 0.5) * bCellW + time * 9.5 + 11.0 * sin(time * 0.65 + bh1 * 6.283);
    float by = 10.0 + 28.0 * bh2 + 3.5 * sin(time * 1.05 + bh2 * 6.283);
    float bRad = 4.2 + 5.5 * bh1;
    float dBokeh = length(p - float2(bx, by));
    float bokeh = smoothstep(bRad, bRad * 0.35, dBokeh) * (0.50 + 0.50 * smoothstep(bRad * 0.52, bRad * 0.92, dBokeh));
    float twinkle = 0.45 + 0.55 * sin(time * 2.4 + bh1 * 19.0);
    float bVis = lerp(0.22, 1.0, smoothstep(headX + 260.0, headX - 30.0, bx));
    float bAmt = bokeh * twinkle * bVis * (0.22 + 0.18 * midFreq);
    col += lerp(sakura, sunGold, bh2) * bAmt;
    alpha = saturate(alpha + bAmt * 0.75);

    // Anime "Kirakira" 4-pointed star glints twinkling on high notes & beat
    float kCellW = 54.0;
    float kid = floor((p.x - time * 14.0) / kCellW);
    float kh1 = hash11(kid * 5.71 + 3.3);
    float kh2 = hash11(kid * 9.13 + 7.7);
    float kx = (kid + 0.5) * kCellW + time * 14.0 + 13.0 * cos(time * 0.8 + kh1 * 6.283);
    float ky = 11.0 + 28.0 * kh2;
    float2 kd = abs(p - float2(kx, ky));
    float kiraBlink = pow(0.5 + 0.5 * sin(time * 3.6 + kh1 * 25.0), 4.0) * (0.50 + 0.65 * highFreq + 0.50 * beat);
    float kiraStar = (exp(-kd.x * 1.8 - kd.y * 0.42) + exp(-kd.y * 1.8 - kd.x * 0.42)) * exp(-length(kd) * 0.42);
    float kiraMask = saturate(kiraStar) * kiraBlink * smoothstep(headX + 300.0, headX - 40.0, kx) * step(0.28, kh1);
    col += lerp(sunGold, ivory, 0.65) * kiraMask * 0.88;
    alpha = max(alpha, kiraMask * 0.82);

    // Delicate tumbling sakura petals carried smoothly on the wind
    float pCellW = 64.0;
    float pid = floor((p.x - time * 25.0) / pCellW);
    float ph1 = hash11(pid * 6.13 + 4.8);
    float ph2 = hash11(pid * 11.9 + 1.3);
    float pxPos = (pid + 0.5) * pCellW + time * 25.0 + 15.0 * sin(time * 0.95 + ph1 * 6.283);
    float pyPos = 9.5 + 29.0 * ph2 + 5.0 * cos(time * 1.35 + ph2 * 6.283);
    float2 pq = rot2d(p - float2(pxPos, pyPos), time * 2.2 + ph1 * 6.283);
    pq.x *= 1.85;
    float petal = smoothstep(2.7, 0.6, length(pq)) * smoothstep(headX + 280.0, headX - 80.0, pxPos) * step(0.30, ph1);
    float3 petalCol = lerp(float3(1.0, 0.68, 0.85), sunGold, ph2 * 0.40);
    col = lerp(col, petalCol, petal * 0.80);
    alpha = max(alpha, petal * 0.78);

    // 4. Hero Blooming Dandelion Flower (+50% Larger: ~39px diameter close-up, smooth swaying!)
    float flowerSway = 3.2 * sin(time * 1.35) + 1.4 * sin(time * 2.45 + 1.1);
    float stemBaseX = headX - flowerSway * 0.25;
    float2 hub = float2(headX + flowerSway, 25.6 + 0.9 * sin(time * 1.35 + 0.7));

    // Low ground-hugging dandelion rosette leaves at the very base of the stem (below the puffball)
    float2 lv = p - float2(stemBaseX, 0.4);
    if (dot(lv, lv) < 160.0 && p.y < 5.5)
    {
        float leafWave = 0.06 * sin(time * 1.8);
        float2 lLeft = rot2d(lv, 1.18 + leafWave) * float2(0.95, 0.24);
        float2 lRight = rot2d(lv, -1.22 + leafWave) * float2(0.95, 0.23);
        float leafL = smoothstep(2.6, 0.7, length(lLeft - float2(0.0, 4.2))) * step(0.0, p.y);
        float leafR = smoothstep(2.8, 0.7, length(lRight - float2(0.0, 4.6))) * step(0.0, p.y);
        float leaves = saturate(leafL + leafR);
        col = lerp(col, lerp(meadow, sunGold, 0.28), leaves * 0.85);
        alpha = max(alpha, leaves * 0.85);
    }

    // Curved botanical stem rising from bottom edge all the way up into the puffball core
    float st = saturate(p.y / max(hub.y, 1.0));
    float stemX = lerp(stemBaseX, hub.x, st * st * (3.0 - 2.0 * st)) - sin(st * 3.14159) * flowerSway * 0.25;
    float stemWidth = lerp(1.65, 1.15, st);
    float stemMask = smoothstep(stemWidth, 0.30, abs(p.x - stemX)) * step(p.y, hub.y) * smoothstep(0.0, 1.5, p.y);
    float3 stemCol = lerp(meadow * 0.82, sunGold, st * 0.50);
    col = lerp(col, stemCol, stemMask * 0.92);
    alpha = max(alpha, stemMask * 0.92);

    // Calyx receptacle cup right under the seed core
    float2 cupV = (p - (hub - float2(flowerSway * 0.05, 2.5))) * float2(0.72, 1.15);
    float cupMask = smoothstep(3.6, 1.3, length(cupV));
    col = lerp(col, lerp(meadow, seedAmber, 0.54), cupMask * 0.92);
    alpha = max(alpha, cupMask * 0.92);

    // Majestic +50% Larger Fluffy Anime Dandelion Puffball (radius ~19.5px, rich double pappus halo)
    float2 fv = p - hub;
    float fr = length(fv);
    float fSafeY = fv.y + (fv.y >= 0.0 ? 0.0001 : -0.0001);
    float fang = atan2(fv.x, fSafeY);
    float2 fDir = fv / max(fr, 0.001);
    float windSide = dot(fDir, float2(0.86, 0.51));
    float shedNotch = 1.0 - 0.20 * smoothstep(0.58, 0.94, windSide);

    float scallop = 0.75 * sin(fang * 11.0 + time * 1.1) + 0.45 * cos(fang * 19.0 - time * 0.75);
    float puffR = (19.4 + scallop) * shedNotch;

    // 22 delicate translucent inner stalks + inner staggered floret layer + lush lacy outer crown
    float dPuffRay = fr * abs(sin(fang * 22.0 + 0.10 * sin(fr * 0.35))) / 22.0;
    float stalkFade = smoothstep(3.2, puffR * 0.86, fr) * smoothstep(puffR + 0.6, puffR - 1.4, fr);
    float puffRays = smoothstep(0.46, 0.06, dPuffRay) * stalkFade * 0.50;

    // Inner secondary ring of fluffy parachutes for realistic 3D depth inside the large sphere
    float innerRingR = puffR * 0.66;
    float dInnerRay = fr * abs(sin(fang * 15.0 + 1.05)) / 15.0;
    float innerTufts = exp(-abs(fr - innerRingR) * 0.75) * smoothstep(0.85, 0.10, dInnerRay) * 0.42;

    // Outer cottony pappus cloud + starry parachute tips
    float outerTufts = exp(-abs(fr - puffR + 1.6) * 0.52)
                     * (0.60 + 0.40 * sin(fang * 22.0) * sin(fang * 22.0))
                     * (1.0 - 0.58 * smoothstep(0.62, 0.95, windSide));
    float innerDown = exp(-fr / (puffR * 0.68)) * smoothstep(puffR * 1.18, puffR * 0.20, fr) * (0.50 + 0.12 * bass);
    float puffTips = smoothstep(0.68, 0.08, dPuffRay)
                   * exp(-abs(fr - puffR + 0.25) * 1.75)
                   * (1.0 - 0.65 * smoothstep(0.64, 0.95, windSide));

    float amberCenter = smoothstep(3.8, 0.9, fr);
    float centerDots = exp(-abs(fr - 3.4) * 1.3) * (0.45 + 0.55 * abs(cos(fang * 9.0)));

    float puffSilk = saturate(puffRays + innerTufts + outerTufts * 0.78 + innerDown + puffTips * 0.88);
    float3 puffInnerTint = lerp(sakura, sunGold, 0.48);
    float3 puffCol = lerp(puffInnerTint, ivory, saturate(0.45 + 0.55 * (fr / max(puffR, 1.0))));
    col = lerp(col, puffCol, puffSilk * 0.95);
    col = lerp(col, lerp(seedAmber, ivory, centerDots * 0.55), amberCenter * 0.94);
    alpha = max(alpha, max(puffSilk * 0.94, amberCenter * 0.94));

    // Warm golden-sakura backlit aura around the large puffball pulsing smoothly with the music
    float flowerAura = exp(-fr / (27.0 + 9.0 * beat)) * (0.24 + 0.30 * beat + 0.12 * bass);
    col += lerp(sunGold, sakura, 0.45) * flowerAura * (1.0 - puffSilk * 0.55);
    alpha = saturate(alpha + flowerAura * 0.55);

    // 5. Two Hero Seeds Smoothly Peeling Off the Upper-Right Rim of the Large Puffball
    [unroll]
    for (int d = 0; d < 2; d++)
    {
        float fd = (float)d;
        float life = frac(time * 0.24 + fd * 0.5);
        float liftFade = smoothstep(0.0, 0.09, life) * smoothstep(1.0, 0.76, life);
        float2 startPos = hub + float2(13.5 + 2.0 * fd, 2.5 + (fd - 0.5) * 5.0);
        float travelX = life * (135.0 + 30.0 * fd);
        float travelY = sin(life * 4.8 + fd * 2.1) * 5.8 + (0.4 - fd * 0.9) * 5.0 * life;
        float2 sPos = startPos + float2(travelX, travelY);

        float tilt = 0.44 + 0.28 * sin(life * 5.2 + fd * 2.4);
        float sScale = 0.94 + 0.16 * smoothstep(0.0, 0.35, life);
        float2 sq = rot2d(p - sPos, tilt) / sScale;
        if (dot(sq, sq) < 105.0)
        {
            float2 sg = dandelionSeed(sq, sScale * barScale, 0.5 + 0.5 * sin(life * 6.283));
            float sSilk = sg.x * liftFade;
            float sGrain = sg.y * liftFade;
            col = lerp(col, lerp(sakura, ivory, 0.85), sSilk * 0.96);
            col = lerp(col, seedAmber, sGrain * 0.96);
            alpha = max(alpha, max(sSilk, sGrain) * 0.96);
        }
    }

    // 6. Three Staggered Silky-Smooth Parallax Wind Layers of Flying Dandelion Seeds
    evalSeedLayer(p, barScale, 38.0, 9.5,  17.0, 1.7, 0.62, 0.76, 0.66, hub, hasProg, audioGlow, skyTone, sakura, sunGold, ivory, seedAmber, col, alpha);
    evalSeedLayer(p, barScale, 52.0, 12.0, 24.5, 5.3, 0.80, 0.96, 0.84, hub, hasProg, audioGlow, skyTone, sakura, sunGold, ivory, seedAmber, col, alpha);
    evalSeedLayer(p, barScale, 66.0, 14.5, 32.0, 9.8, 0.98, 1.18, 0.96, hub, hasProg, audioGlow, skyTone, sakura, sunGold, ivory, seedAmber, col, alpha);

    return paint(col, alpha);
}