AI GENERATED

たいがいのケースを今 繋がる経緯を編み 培う星図

by mimi

PROMPT

たいがいのケースを今 繋がる経緯を編み 培う星図の域 甲なぞって腕に吐き出して夢に毎回のケースを今 暗い道は置き去り 散らかった冬至の的 甲なぞって腕に吐き出して砂に 曖昧線に飛び乗って つないだ手を壊す君 空中戦に灯がついて暮れる耳書いてある 無駄にそっと刻む 潜る閃々の影 イージー線にくるまって 沈む氷気が付いて 愛情線の塔になって 暮れる耳書いてある ゆける秘蔵無 戸惑う意味 たとえ時候

DATE
2026/6/17
SOURCE
AI GENERATED
MODEL
gemini-2.5-flash
LIKES
0
VIEW SHADER CODE
vec2 hash2(vec2 p) {
    p = vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)));
    return fract(sin(p) * 43758.5453123);
}

float hash1(float n) {
    return fract(sin(n) * 43758.5453123);
}

float noise(vec2 p) {
    vec2 ip = floor(p);
    vec2 fp = fract(p);
    fp = fp * fp * (3.0 - 2.0 * fp);

    float a = hash1(ip.x + ip.y * 57.0);
    float b = hash1(ip.x + 1.0 + ip.y * 57.0);
    float c = hash1(ip.x + (ip.y + 1.0) * 57.0);
    float d = hash1(ip.x + 1.0 + (ip.y + 1.0) * 57.0);

    return mix(mix(a, b, fp.x), mix(c, d, fp.x), fp.y);
}

float fbm(vec2 p) {
    float f = 0.0;
    float amp = 0.5;
    for (int i = 0; i < 5; i++) { // 5 octaves
        f += amp * noise(p);
        p *= 2.0;
        amp *= 0.5;
    }
    return f;
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
    vec2 uv = (fragCoord * 2.0 - iResolution.xy) / iResolution.y;
    float time = iTime * 0.1;

    // Domain warping: creates "ambiguous lines" and "weaving connecting histories"
    vec2 warped_uv = uv;
    warped_uv += fbm(uv * 3.0 + time * 1.5) * 0.2;
    warped_uv += fbm(uv * 5.0 - time * 0.7) * 0.15;
    warped_uv += fbm(uv * 8.0 + time * 0.3) * 0.1;

    // Voronoi setup: creates "scattered targets" and "lines"
    vec2 p_voronoi = warped_uv * 4.5; // Scale for cell density
    p_voronoi += vec2(sin(time * 0.5), cos(time * 0.4)) * 0.3; // Animate overall position

    vec2 ip = floor(p_voronoi);
    vec2 fp = fract(p_voronoi);

    float min_dist1 = 100.0;
    float min_dist2 = 100.0;

    for (int y = -1; y <= 1; y++) {
        for (int x = -1; x <= 1; x++) {
            vec2 neighbor = vec2(float(x), float(y));
            vec2 current_cell = ip + neighbor;

            vec2 feature_point = hash2(current_cell); // Random point in cell

            // Jitter feature points based on time: "glittering", "flickering"
            feature_point = 0.5 + 0.5 * sin(feature_point * 6.28318 + time * 2.0);

            vec2 r = neighbor + feature_point - fp; // Vector from frag point to feature point

            // "Sinking ice" / "dissolving" effect: move feature points away based on time
            float dist_offset = sin(dot(current_cell, vec2(12.9898, 78.233)) * 43758.5453 + time * 3.0) * 0.1 + 0.1;
            r += normalize(r) * dist_offset * (0.5 + 0.5 * sin(time * 0.8)); // Radial outward movement

            float d = dot(r, r); // Squared distance

            if (d < min_dist1) {
                min_dist2 = min_dist1;
                min_dist1 = d;
            } else if (d < min_dist2) {
                min_dist2 = d;
            }
        }
    }

    min_dist1 = sqrt(min_dist1);
    min_dist2 = sqrt(min_dist2);

    // Voronoi F2-F1: Emphasizes the cell boundaries as "lines"
    float v_f2_f1 = min_dist2 - min_dist1; 
    
    // Sharpen and enhance contrast for "tower of love lines"
    float pattern_val = smoothstep(0.0, 0.4, v_f2_f1 * 2.0);
    pattern_val = pow(pattern_val, 1.5); 

    // Add more layers of noise for "glittering, flickering shadows"
    float detail_noise = fbm(uv * 15.0 + time * 2.0) * 0.5 + 0.5; // Range [0,1]
    pattern_val += detail_noise * 0.1;

    // Rich, harmonious color palette
    vec3 col_a = vec3(0.05, 0.1, 0.2); // Deep blue
    vec3 col_b = vec3(0.8, 0.4, 0.2);  // Fiery orange
    vec3 col_c = vec3(0.9, 0.8, 0.7);  // Soft cream
    vec3 col_d = vec3(0.2, 0.6, 0.7);  // Teal

    // Dynamic color mixing based on time and position
    vec3 palette_mix = mix(col_a, col_b, smoothstep(0.0, 1.0, sin(time * 0.3 + uv.x * 0.5) * 0.5 + 0.5));
    palette_mix = mix(palette_mix, col_c, smoothstep(0.0, 1.0, cos(time * 0.5 + uv.y * 0.5) * 0.5 + 0.5));
    palette_mix = mix(palette_mix, col_d, smoothstep(0.0, 1.0, sin(time * 0.2 + uv.x * uv.y) * 0.5 + 0.5));

    // Combine pattern with color: "lights ignite"
    vec3 final_color = mix(vec3(0.05, 0.05, 0.1), palette_mix, pattern_val);

    // Add glow to the lines
    final_color += palette_mix * pow(smoothstep(0.0, 0.05, v_f2_f1), 5.0) * 2.0;

    // Subtle vignette
    float vignette = 1.0 - dot(uv, uv) * 0.15;
    final_color *= vignette;

    fragColor = vec4(final_color, 1.0);
}

ZIP を展開して .playground を Xcode でダブルクリックし、Live View を表示して ▶ を押すとシェーダーがアニメーションします。Metal ソースは Resources/Shader.metal に独立ファイルとして入っているので、Xcode 上で直接編集できます。