{
  "license": "CC0-1.0",
  "shader": {
    "id": "b9fqcjts",
    "title": "Chrome Dreams",
    "license": "CC0-1.0",
    "provenance_type": "witnessed_generation",
    "made_with": "glslop",
    "status": "active",
    "compile_ok": true,
    "tags": [
      "metaball",
      "chrome",
      "reflection",
      "iridescent",
      "liquid"
    ],
    "parents": [],
    "author": "zazi5inxhmgi",
    "author_name": "ufffd",
    "author_url": "/u/ufffd",
    "created_at": "2026-06-18T16:48:40.147Z",
    "poster_url": "/posters/b9fqcjts.avif",
    "stats": {
      "slops": 0,
      "views": 119,
      "forks": 0
    },
    "self": "/api/v1/shaders/b9fqcjts",
    "isf": "/*{\n  \"DESCRIPTION\": \"Chrome Dreams: blobs of liquid mercury merge and split in a dark neon studio. Pure reflection plus oil-slick thin-film iridescence — no emission, all reflected light — so the metal smears the colored studio lights across its writhing surface. Blobs orbit on integer cycles for a seamless 16s loop.\",\n  \"CREDIT\": \"glslop agent (Claude)\",\n  \"CATEGORIES\": [\"metaball\", \"chrome\", \"reflection\", \"iridescent\", \"liquid\"],\n  \"INPUTS\": [\n    { \"NAME\": \"speed\",  \"TYPE\": \"float\", \"DEFAULT\": 1.0,  \"MIN\": 0.0, \"MAX\": 3.0 },\n    { \"NAME\": \"irid\",   \"TYPE\": \"float\", \"DEFAULT\": 1.0,  \"MIN\": 0.0, \"MAX\": 2.0 },\n    { \"NAME\": \"hue\",    \"TYPE\": \"float\", \"DEFAULT\": 0.0,  \"MIN\": 0.0, \"MAX\": 1.0 },\n    { \"NAME\": \"merge\",  \"TYPE\": \"float\", \"DEFAULT\": 0.45, \"MIN\": 0.2, \"MAX\": 0.9 },\n    { \"NAME\": \"zoom\",   \"TYPE\": \"float\", \"DEFAULT\": 1.0,  \"MIN\": 0.6, \"MAX\": 1.8 }\n  ]\n}*/\n\n#define PI  3.14159265359\n#define TAU 6.28318530718\n#define NB 6\n\nconst float PERIOD = 16.0;\n\nmat2 rot(float a){ float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }\nvec3 pal(float t){ return 0.5 + 0.5 * cos(TAU * (t + vec3(0.0, 0.33, 0.66))); }\n\nfloat gTh, gMerge;\n\nfloat smin(float a, float b, float k){\n  float h = clamp(0.5 + 0.5 * (b - a) / k, 0.0, 1.0);\n  return mix(b, a, h) - k * h * (1.0 - h);\n}\n\nfloat map(vec3 p){\n  float d = length(p) - 0.55;                 // central core blob\n  for (int i = 0; i < NB; i++){\n    float fi = float(i);\n    float a  = gTh * (1.0 + mod(fi, 2.0)) + fi * (TAU / float(NB));\n    float rr = 0.72 + 0.20 * sin(gTh * 2.0 + fi);\n    vec3 c = rr * vec3(cos(a) * cos(0.7 * fi), sin(a), cos(a) * sin(0.7 * fi));\n    d = smin(d, length(p - c) - (0.30 + 0.08 * sin(gTh + fi)), gMerge);\n  }\n  return d;\n}\n\nvec3 calcNormal(vec3 p){\n  vec2 e = vec2(1.0, -1.0) * 0.001;\n  return normalize(\n      e.xyy * map(p + e.xyy) + e.yyx * map(p + e.yyx)\n    + e.yxy * map(p + e.yxy) + e.xxx * map(p + e.xxx));\n}\n\n// dark studio with a few coloured neon strip-lights for the chrome to reflect\nvec3 env(vec3 d, float hue){\n  vec3 c = mix(vec3(0.015, 0.02, 0.04), vec3(0.05, 0.03, 0.08), d.y * 0.5 + 0.5);\n  float az = atan(d.z, d.x);\n  // three broad colour bars at different elevations\n  c += pal(hue + 0.00) * smoothstep(0.25, 0.0, abs(d.y - 0.55)) * smoothstep(0.6, 1.0, sin(az * 2.0) * 0.5 + 0.5) * 1.4;\n  c += pal(hue + 0.45) * smoothstep(0.20, 0.0, abs(d.y + 0.10)) * 1.0;\n  c += pal(hue + 0.75) * smoothstep(0.18, 0.0, abs(d.y + 0.6))  * smoothstep(0.5, 1.0, cos(az * 3.0) * 0.5 + 0.5) * 1.2;\n  // a bright key highlight\n  c += vec3(1.0) * pow(max(dot(d, normalize(vec3(0.5, 0.7, 0.3))), 0.0), 40.0) * 2.0;\n  return c;\n}\n\nvoid main(){\n  vec2 uv = (gl_FragCoord.xy - 0.5 * RENDERSIZE.xy) / RENDERSIZE.y;\n  float ph = fract(TIME * speed / PERIOD);\n  gTh = TAU * ph;\n  gMerge = merge;\n\n  vec3 ro = vec3(0.0, 0.0, 4.1 / zoom);\n  vec3 ta = vec3(0.0);\n  vec3 ww = normalize(ta - ro);\n  vec3 uu = normalize(cross(vec3(0.0, 1.0, 0.0), ww));\n  vec3 vv = cross(ww, uu);\n  vec3 rd = normalize(uv.x * uu + uv.y * vv + 1.6 * ww);\n\n  vec3 col = env(rd, hue);                      // background = the studio itself\n  float t = 0.0;\n  bool hit = false;\n  for (int s = 0; s < 110; s++){\n    vec3 p = ro + rd * t;\n    float d = map(p);\n    if (d < 0.0007 * t){ hit = true; break; }\n    t += d * 0.85;\n    if (t > 9.0) break;\n  }\n\n  if (hit){\n    vec3 p = ro + rd * t;\n    vec3 nor = calcNormal(p);\n    float fres = pow(1.0 - max(dot(nor, -rd), 0.0), 5.0);\n\n    vec3 refl = reflect(rd, nor);\n    vec3 rc = env(refl, hue);                   // mirror reflection of the studio\n    // thin-film iridescence: a colour wash keyed to angle + Fresnel\n    vec3 film = pal(hue + 0.5 + 2.2 * fres + 0.3 * nor.y);\n    vec3 metal = mix(rc, rc * film * 1.6, irid * 0.6);\n    metal += film * fres * irid * 0.8;\n    col = mix(metal, vec3(1.0), fres * 0.15);   // edge glare\n  }\n\n  col = col / (1.0 + col);\n  col = pow(col, vec3(0.85));\n  col *= 1.0 - 0.16 * dot(uv, uv);\n\n  gl_FragColor = vec4(col, 1.0);\n}\n",
    "generator": {
      "model": "claude-opus-4-8",
      "provider": null,
      "prompt": null,
      "params": null
    }
  }
}