Snow

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

Vô Tuyết

71 lượt tải Tải file, 10.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 7e69828ed7eee23d7c0808c95343110f5e4b5da42f82cd9453f0505008dd7279

//! name: Yukizora Kessho (Sóng Tuyết Sakura Mềm)
//! author: Antigravity
//! kind: progress
//! description: Ba lớp sóng lụa băng hồng-lam uốn lượn mềm mại dâng cao theo nhạc, kết hợp đại tinh thể tuyết xoay ở đầu phát và tuyết 6 cánh rơi êm 60fps

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);
}

// 5-tap Gaussian-smoothed spectrum lookup so music waves rise in soft, expressive, rounded hills
float smoothBand(float f)
{
    float s0 = spectrum(f - 0.044);
    float s1 = spectrum(f - 0.022);
    float s2 = spectrum(f);
    float s3 = spectrum(f + 0.022);
    float s4 = spectrum(f + 0.044);
    return s0 * 0.12 + s1 * 0.24 + s2 * 0.28 + s3 * 0.24 + s4 * 0.12;
}

// 6-fold hexagonal dendritic snow crystal (zero loops via D6 symmetry folding)
float snowCrystal(float2 q, float R, float aa)
{
    float r = length(q);
    float safeX = q.x + (q.x >= 0.0 ? 0.0001 : -0.0001);
    float ang = atan2(q.y, safeX);
    float sector = 1.04719755;
    float a = abs(ang - sector * floor(ang / sector + 0.5));
    float u = r * cos(a);
    float v = r * sin(a);

    float armW = R * 0.054;
    float mainArm = smoothstep(armW + aa, armW * 0.18, v) * smoothstep(R + aa, R - aa * 1.2, u);

    float hexDist = r * cos(0.5235988 - a);
    float hexR = R * 0.31;
    float hexRing = smoothstep(armW * 1.15 + aa, armW * 0.15, abs(hexDist - hexR));
    float hexFill = smoothstep(hexR, hexR * 0.35, hexDist) * 0.24;

    float2 d1 = float2(u - R * 0.42, v);
    float t1 = clamp(d1.x * 0.5 + d1.y * 0.8660254, 0.0, R * 0.35);
    float br1 = smoothstep(armW * 0.85 + aa, armW * 0.12, length(d1 - float2(0.5, 0.8660254) * t1));

    float2 d2 = float2(u - R * 0.68, v);
    float t2 = clamp(d2.x * 0.5 + d2.y * 0.8660254, 0.0, R * 0.23);
    float br2 = smoothstep(armW * 0.78 + aa, armW * 0.12, length(d2 - float2(0.5, 0.8660254) * t2));

    float core = smoothstep(R * 0.16 + aa, 0.1, r) * 0.90;
    float frost = exp(-r / max(R * 0.55, 0.5)) * 0.30;
    return saturate(max(max(mainArm, hexRing), max(br1, br2)) + hexFill + core + frost) * step(r, R + 2.0);
}

void evalSnowLayer(
    float2 p, float barScale, float cw, float driftSpeed, float fallSpeed,
    float baseR, float puffMix, float baseAlpha, float seedOff, float2 hub, float audioGlow,
    float3 winterBlue, float3 sakuraPink, float3 pureIce,
    inout float3 col, inout float alpha)
{
    float cid = floor((p.x - time * driftSpeed) / cw);
    float h1 = hash11(cid * 5.13 + seedOff);
    float h2 = hash11(cid * 9.71 + seedOff * 1.7);

    float sx = (cid + 0.5) * cw + time * driftSpeed + (cw * 0.22) * sin(time * (0.72 + 0.32 * h1) + h1 * 6.283);
    float fallPhase = frac(h2 - time * fallSpeed / 64.0);
    float sy = -6.0 + fallPhase * 60.0;

    float sR = baseR * (0.82 + 0.32 * h1);
    float clearHub = smoothstep(21.0, 32.0, length(float2(sx, sy) - hub));
    float2 delta = p - float2(sx, sy);
    if (dot(delta, delta) < (sR + 3.5) * (sR + 3.5) && clearHub > 0.01)
    {
        float flk;
        if (h1 > puffMix)
        {
            float2 sq = rot2d(delta, time * (0.45 + 0.35 * h1) + h2 * 6.283);
            flk = snowCrystal(sq, sR, 0.56 / barScale);
        }
        else
        {
            // Soft out-of-focus cottony snow puff for extra winter softness
            float pR = sR * 0.58;
            flk = exp(-dot(delta, delta) / max(pR * pR * 0.55, 0.4)) * 0.88;
        }
        flk *= baseAlpha * clearHub;
        float halo = exp(-length(delta) / (sR * 1.35)) * (0.14 + 0.14 * audioGlow) * baseAlpha * clearHub;
        float3 fCol = lerp(lerp(winterBlue, sakuraPink, h1 * 0.58), pureIce, 0.82);
        col += fCol * halo;
        col = lerp(col, fCol, flk);
        alpha = max(alpha, saturate(flk + halo * 0.7));
    }
}

float4 main(float2 uv : TEXCOORD) : COLOR
{
    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;

    // Continuous, silky-smooth symmetric frequency mapping across the taskbar
    float symU = abs(uv.x - 0.5) * 1.62;
    float bandMain = smoothBand(symU);
    float bandShifted = smoothBand(frac(symU * 0.68 + 0.14));
    float bass = smoothBand(0.06);
    float midFreq = smoothBand(0.32);
    float highFreq = spectrum(0.72);
    float audioGlow = saturate(0.58 * level + 0.42 * beat);

    // Palette: Makoto Shinkai winter twilight (ice blue + fuyuzakura pink + soft frost ivory)
    float3 pureIce = float3(0.97, 0.99, 1.0);
    float3 sakuraPink = lerp(colorA.rgb, float3(1.0, 0.64, 0.87), 0.46);
    float3 winterBlue = lerp(colorB.rgb, float3(0.38, 0.75, 1.0), 0.44);
    float3 lavenderMist = lerp(sakuraPink, winterBlue, 0.48);
    float3 frostGold = lerp(colorC.rgb, float3(1.0, 0.87, 0.66), 0.42);

    float hasProg = step(0.002, progress);
    float headU = lerp(0.50, clamp(progress, 0.032, 0.968), hasProg);
    float headX = headU * barW;

    // Wide, velvety transition around playhead (soft cushion so the big snowflake gleams cleanly)
    float played = smoothstep(headX + 12.0, headX - 18.0, p.x);
    float activeZone = lerp(1.0, played, hasProg);
    float heroCushion = lerp(1.0, smoothstep(5.0, 28.0, abs(p.x - headX)) * 0.66 + 0.34, hasProg);

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

    // 1. Three Soft, Flowing Multi-Layer Snow-Silk Waves Rising Smoothly with the Music
    float swell1 = 0.5 + 0.5 * sin(p.x * 0.028 - time * 2.1) * cos(p.x * 0.011 + time * 0.9);
    float swell2 = 0.5 + 0.5 * sin(p.x * 0.036 + time * 1.65 + 1.7) * cos(p.x * 0.014 - time * 1.1);
    float swell3 = 0.5 + 0.5 * cos(p.x * 0.031 - time * 2.35 + 0.8);

    float eBase = saturate(bandMain * 0.76 + bandShifted * 0.26 + bass * 0.16) * (1.0 + 0.25 * beat);

    // Layer A (Back): Tall, pillowy sakura-lavender aurora mist wave (reaches up to ~84% height)
    float hBack = clamp((0.12 + 0.10 * swell1 + eBase * (0.78 + 0.20 * swell2)) * 41.5, 5.0, 41.5);
    float backBody = smoothstep(hBack + 5.5, hBack - 7.5, p.y) * smoothstep(hBack + 6.0, 0.0, p.y * 0.65);
    float backCrest = exp(-abs(p.y - hBack + 1.5) / 3.8) * 0.48;
    float visBack = lerp(0.14, 0.52, activeZone) * heroCushion;
    float3 colBack = lerp(winterBlue, sakuraPink, saturate(p.y / 34.0 + 0.18));
    col += colBack * (backBody + backCrest) * visBack;
    alpha = saturate((backBody * 0.85 + backCrest * 0.65) * visBack);

    // Layer B (Middle): Silky flowing ice-blue -> sakura ribbon wave with soft luminous rim
    float eMid = saturate(bandShifted * 0.60 + bandMain * 0.40 + midFreq * 0.18) * (1.0 + 0.20 * beat);
    float hMid = clamp((0.11 + 0.09 * swell2 + eMid * (0.66 + 0.16 * swell3)) * 37.5, 4.5, 37.5);
    float midBody = smoothstep(hMid + 2.6, hMid - 4.2, p.y);
    float midRim = exp(-abs(p.y - hMid) / 2.1);
    float visMid = lerp(0.16, 0.66, activeZone) * heroCushion;
    float3 colMid = lerp(winterBlue, lerp(lavenderMist, pureIce, 0.55), saturate(p.y / max(hMid, 1.0)));
    col = lerp(col, colMid, midBody * visMid * 0.72);
    col += lerp(sakuraPink, pureIce, 0.65) * midRim * lerp(0.12, 0.56, activeZone) * heroCushion;
    alpha = max(alpha, saturate(midBody * visMid * 0.78 + midRim * 0.45 * activeZone * heroCushion));

    // Layer C (Front): Pillowy snowy foreground wave with creamy sunlit-frost crest
    float hFront = clamp((0.09 + 0.07 * swell3 + (bass * 0.48 + bandMain * 0.52) * (0.48 + 0.14 * swell1)) * 30.0, 3.8, 29.0);
    float frontBody = smoothstep(hFront + 1.8, hFront - 2.8, p.y);
    float frontRim = exp(-abs(p.y - hFront) / 1.55);
    float visFront = lerp(0.18, 0.82, activeZone) * heroCushion;
    float3 snowBelly = lerp(winterBlue * 0.92, sakuraPink * 0.95, uv.x * 0.55);
    float3 colFront = lerp(snowBelly, pureIce, saturate(pow(saturate(p.y / max(hFront, 1.0)), 1.5) * 0.88));
    col = lerp(col, colFront, frontBody * visFront * 0.82);
    col += pureIce * frontRim * lerp(0.14, 0.62, activeZone) * heroCushion;
    alpha = max(alpha, saturate(frontBody * visFront * 0.85 + frontRim * 0.50 * activeZone * heroCushion));

    // Soft dreamy bokeh orbs floating inside the winter wave
    float bCell = floor((p.x - time * 8.0) / 52.0);
    float bh1 = hash11(bCell * 3.9 + 1.4);
    float bh2 = hash11(bCell * 8.3 + 5.2);
    float2 bPos = float2((bCell + 0.5) * 52.0 + time * 8.0 + 11.0 * sin(time * 0.6 + bh1 * 6.283), 9.0 + 22.0 * bh2);
    float bR = 5.5 + 5.5 * bh1;
    float dB = length(p - bPos);
    float bokeh = exp(-dB * dB / (bR * bR * 0.45)) * (0.18 + 0.14 * midFreq) * lerp(0.22, 1.0, activeZone);
    col += lerp(sakuraPink, frostGold, bh2 * 0.55) * bokeh;
    alpha = saturate(alpha + bokeh * 0.65);

    // 2. Frost Kirakira 4-Pointed Stars Twinkling Gently on High Notes
    float kCell = floor((p.x - time * 11.5) / 50.0);
    float kh1 = hash11(kCell * 6.31 + 2.7);
    float2 kp = float2((kCell + 0.5) * 50.0 + time * 11.5, 14.0 + 26.0 * hash11(kCell * 11.9));
    float2 kd = abs(p - kp);
    float glint = (exp(-kd.x * 1.9 - kd.y * 0.4) + exp(-kd.y * 1.9 - kd.x * 0.4)) * exp(-length(kd) * 0.4);
    float blink = pow(0.5 + 0.5 * sin(time * 3.4 + kh1 * 23.0), 4.0) * (0.42 + 0.65 * highFreq + 0.40 * beat);
    float gMask = saturate(glint) * blink * step(0.32, kh1) * smoothstep(20.0, 30.0, length(kp - float2(headX, 24.5)));
    col += lerp(frostGold, pureIce, 0.68) * gMask * 0.85;
    alpha = max(alpha, gMask * 0.80);

    // 3. Three Silky-Smooth Parallax Layers of Mixed 6-Pointed Snowflakes & Soft Powder Snow
    float2 hub = float2(headX, 24.5 + 1.0 * sin(time * 1.3));
    evalSnowLayer(p, barScale, 34.0, 3.8, 9.0,  3.7, 0.48, 0.58, 1.3, hub, audioGlow, winterBlue, sakuraPink, pureIce, col, alpha);
    evalSnowLayer(p, barScale, 48.0, 6.0, 12.8, 5.5, 0.30, 0.78, 5.7, hub, audioGlow, winterBlue, sakuraPink, pureIce, col, alpha);
    evalSnowLayer(p, barScale, 64.0, 8.2, 16.8, 7.6, 0.15, 0.95, 9.4, hub, audioGlow, winterBlue, sakuraPink, pureIce, col, alpha);

    // 4. Hero Giant Spinning Hexagonal Snow Crystal at Playhead (~39px!)
    if (hasProg > 0.5)
    {
        float dHub = length(p - hub);
        float heroAura = exp(-dHub / (22.0 + 7.0 * beat)) * (0.36 + 0.28 * beat);
        col += lerp(sakuraPink, winterBlue, 0.45) * heroAura;
        alpha = saturate(alpha + heroAura * 0.65);

        float2 hv = rot2d(p - hub, time * 0.36);
        float heroFlake = snowCrystal(hv, 19.0, 0.52 / barScale);
        float3 heroCol = lerp(lerp(winterBlue, sakuraPink, 0.42), pureIce, 0.86);
        col = lerp(col, heroCol, heroFlake * 0.97);
        alpha = max(alpha, heroFlake * 0.97);
    }

    return paint(col, alpha);
}