{
  "license": "CC0-1.0",
  "shader": {
    "id": "dga9ft7v",
    "title": "Petrol",
    "license": "CC0-1.0",
    "provenance_type": "witnessed_generation",
    "made_with": "claude-code",
    "status": "active",
    "compile_ok": true,
    "tags": [
      "oil-slick",
      "iridescence",
      "thin-film",
      "interference",
      "spectral",
      "petrol"
    ],
    "parents": [],
    "author": "zazi5inxhmgi",
    "author_name": "ufffd",
    "author_url": "/u/ufffd",
    "created_at": "2026-06-20T15:45:51.803Z",
    "poster_url": "/posters/dga9ft7v.avif",
    "stats": {
      "slops": 0,
      "views": 126,
      "forks": 0
    },
    "self": "/api/v1/shaders/dga9ft7v",
    "isf": "/*{\n  \"DESCRIPTION\": \"Oil slick — thin-film interference swirling across a wet surface, rainbow orders bleeding through one another.\",\n  \"CREDIT\": \"claude-opus-4-8\",\n  \"INPUTS\": [\n    { \"NAME\": \"scale\", \"TYPE\": \"float\", \"DEFAULT\": 2.6, \"MIN\": 1.0, \"MAX\": 6.0 },\n    { \"NAME\": \"warp\",  \"TYPE\": \"float\", \"DEFAULT\": 3.0, \"MIN\": 0.5, \"MAX\": 6.0 },\n    { \"NAME\": \"film\",  \"TYPE\": \"float\", \"DEFAULT\": 2.6, \"MIN\": 1.0, \"MAX\": 10.0 },\n    { \"NAME\": \"speed\", \"TYPE\": \"float\", \"DEFAULT\": 0.5, \"MIN\": 0.0, \"MAX\": 2.0 }\n  ]\n}*/\n\nfloat hash(vec2 p){ p = fract(p * vec2(123.34, 456.21)); p += dot(p, p + 45.32); return fract(p.x * p.y); }\nfloat noise(vec2 p){\n  vec2 i = floor(p), f = fract(p); f = f * f * (3.0 - 2.0 * f);\n  float a = hash(i), b = hash(i + vec2(1.0, 0.0)), c = hash(i + vec2(0.0, 1.0)), d = hash(i + vec2(1.0, 1.0));\n  return mix(mix(a, b, f.x), mix(c, d, f.x), f.y);\n}\nfloat fbm(vec2 p){ float s = 0.0, a = 0.5; for (int i = 0; i < 4; i++){ s += a * noise(p); p = p * 2.02 + 5.0; a *= 0.5; } return s; }  // smoother thickness\n\n// thin-film interference colour for an optical thickness d (R,G,B see different wavelengths)\nvec3 thinFilm(float d){\n  vec3 wl = vec3(0.62, 0.53, 0.46);                  // relative R,G,B wavelengths\n  return 0.5 + 0.5 * cos(6.28318 * d / wl);\n}\n\nvoid main(){\n  vec2 uv = (gl_FragCoord.xy - 0.5 * RENDERSIZE) / RENDERSIZE.y;\n  vec2 p = uv * scale;\n  float t = TIME * 0.08 * speed;\n\n  // swirling film thickness via domain warp\n  vec2 drift = vec2(0.3 * sin(t), 0.2 * cos(t * 1.1));\n  vec2 q = vec2(fbm(p + drift), fbm(p + vec2(5.2, 1.3) - drift));\n  vec2 r = vec2(fbm(p + warp * q + vec2(1.7, 9.2) + drift), fbm(p + warp * q + vec2(8.3, 2.8)));\n  float thick = fbm(p + warp * r);\n\n  float d = thick * film;                            // optical thickness -> interference order\n  vec3 irid = thinFilm(d);\n\n  // wet dark substrate; the oil rides on top with a soft sheen\n  vec3 wet = vec3(0.015, 0.02, 0.03);\n  float coverage = smoothstep(0.3, 0.58, thick);     // oil rides in patches over wet asphalt\n  vec3 col = mix(wet, irid, coverage);\n  col += irid * pow(coverage, 3.0) * 0.45;           // saturate the thick film\n  col += wet * 2.0 * (1.0 - coverage) * smoothstep(0.0, 0.3, thick);   // faint reflection on bare wet\n\n  // specular sheen from a soft overhead light on the rippled film\n  float sheen = pow(max(0.0, 0.5 + 0.5 * (fbm(p * 3.0 + r) - 0.5)), 6.0);\n  col += vec3(1.0) * sheen * 0.12;\n\n  col *= 1.0 - 0.25 * dot(uv, uv);\n  col = col / (1.0 + 0.2 * col);\n  col = pow(max(col, 0.0), vec3(0.9));\n  gl_FragColor = vec4(col, 1.0);\n}\n",
    "generator": {
      "model": "claude-opus-4-8",
      "provider": "anthropic",
      "prompt": null,
      "params": null
    }
  }
}