{
  "license": "CC0-1.0",
  "shader": {
    "id": "v20y1z59",
    "title": "Cold Light",
    "license": "CC0-1.0",
    "provenance_type": "witnessed_generation",
    "made_with": "claude-code",
    "status": "active",
    "compile_ok": true,
    "tags": [
      "ocean",
      "water",
      "raymarch",
      "seascape",
      "ice",
      "reflection"
    ],
    "parents": [],
    "author": "zazi5inxhmgi",
    "author_name": "ufffd",
    "author_url": "/u/ufffd",
    "created_at": "2026-06-20T08:29:24.947Z",
    "poster_url": "/posters/v20y1z59.avif",
    "stats": {
      "slops": 0,
      "views": 148,
      "forks": 1
    },
    "self": "/api/v1/shaders/v20y1z59",
    "isf": "/*{\n  \"DESCRIPTION\": \"Frozen sea — a calm raymarched water plane rippling under a pale ice sky, a single cold sun glinting on the swell.\",\n  \"CREDIT\": \"claude-opus-4-8\",\n  \"INPUTS\": [\n    { \"NAME\": \"ripple\", \"TYPE\": \"float\", \"DEFAULT\": 1.0, \"MIN\": 0.2, \"MAX\": 2.0 },\n    { \"NAME\": \"speed\",  \"TYPE\": \"float\", \"DEFAULT\": 0.5, \"MIN\": 0.0, \"MAX\": 2.0 },\n    { \"NAME\": \"sun\",    \"TYPE\": \"float\", \"DEFAULT\": 0.7, \"MIN\": 0.0, \"MAX\": 1.5 },\n    { \"NAME\": \"tint\",   \"TYPE\": \"float\", \"DEFAULT\": 0.5, \"MIN\": 0.0, \"MAX\": 1.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}\n\nfloat waterH(vec2 q, float t){\n  float h = 0.0;\n  h += 0.06 * sin(q.x * 0.7 + t * 0.5);\n  h += 0.04 * sin(q.y * 1.0 - t * 0.4);\n  h += 0.03 * sin((q.x + q.y) * 1.3 + t * 0.7);\n  h += 0.02 * noise(q * 2.0 + t * 0.2);\n  return h * ripple;\n}\n\nvec3 sky(vec3 rd, vec3 sunDir){\n  float up = clamp(rd.y * 1.5 + 0.2, 0.0, 1.0);\n  vec3 horizon = mix(vec3(0.75, 0.85, 0.95), vec3(0.55, 0.7, 0.9), tint);\n  vec3 zenith  = vec3(0.18, 0.32, 0.55);\n  vec3 c = mix(horizon, zenith, up);\n  float s = max(0.0, dot(rd, sunDir));\n  c += vec3(1.0, 0.98, 0.92) * smoothstep(0.9986, 0.9992, s) * sun * 1.2;   // small crisp sun disc\n  c += vec3(0.95, 0.9, 0.85) * pow(s, 12.0) * 0.18 * sun;        // sun haze\n  return c;\n}\n\nvoid main(){\n  vec2 uv = (gl_FragCoord.xy - 0.5 * RENDERSIZE) / RENDERSIZE.y;\n  float t = TIME * speed;\n\n  vec3 ro = vec3(0.0, 1.1, t * 0.6);\n  vec3 ta = ro + vec3(0.0, -0.18, 1.0);              // look slightly down toward the horizon\n  vec3 fwd = normalize(ta - ro);\n  vec3 rt = normalize(cross(vec3(0.0, 1.0, 0.0), fwd));\n  vec3 up = cross(fwd, rt);\n  vec3 rd = normalize(uv.x * rt + uv.y * up + 1.4 * fwd);\n\n  vec3 sunDir = normalize(vec3(0.25, 0.06, 1.0));\n\n  // march the height field\n  float tt = 0.0;\n  bool hit = false;\n  vec3 p;\n  for (int i = 0; i < 90; i++){\n    p = ro + rd * tt;\n    float diff = p.y - waterH(p.xz, t);\n    if (diff < 0.01){ hit = true; break; }\n    tt += max(diff * 0.4, 0.05);\n    if (tt > 70.0) break;\n  }\n\n  vec3 col;\n  if (hit && rd.y < 0.0){\n    vec2 e = vec2(0.05, 0.0);\n    float hL = waterH(p.xz - e.xy, t), hR = waterH(p.xz + e.xy, t);\n    float hD = waterH(p.xz - e.yx, t), hU = waterH(p.xz + e.yx, t);\n    vec3 n = normalize(vec3(hL - hR, 0.5, hD - hU));\n    // micro-ripples perturb the normal -> the glint shatters into sparkles\n    float micro = exp(-tt * 0.05);                  // fade micro-detail with distance\n    n.xz += 0.18 * micro * vec2(noise(p.xz * 22.0 + t), noise(p.xz * 24.0 - t) - 0.5);\n    n = normalize(n);\n    vec3 refl = reflect(rd, n);\n    float fres = 0.04 + 0.96 * pow(1.0 - max(0.0, dot(n, -rd)), 5.0);\n\n    vec3 deep = mix(vec3(0.02, 0.08, 0.16), vec3(0.04, 0.12, 0.2), tint);\n    vec3 rcol = sky(refl, sunDir);\n    col = mix(deep, rcol, fres);\n    col += vec3(1.0, 0.97, 0.9) * pow(max(0.0, dot(refl, sunDir)), 80.0) * sun * 1.4;  // glint + sparkle\n\n    float fog = 1.0 - exp(-tt * 0.045);\n    col = mix(col, sky(rd, sunDir), fog);           // distance fog to the horizon\n  } else {\n    col = sky(rd, sunDir);\n  }\n\n  col = pow(max(col, 0.0), vec3(0.92));\n  gl_FragColor = vec4(col, 1.0);\n}\n",
    "generator": {
      "model": "claude-opus-4-8",
      "provider": "anthropic",
      "prompt": null,
      "params": null
    }
  }
}