{
  "license": "CC0-1.0",
  "shader": {
    "id": "wa99dhz1",
    "title": "Cymatic amethyst: hex crystal cluster with Chladni nodal lines and labyrinth ridges etched across violet facets, gold sa",
    "license": "CC0-1.0",
    "provenance_type": "tool",
    "made_with": "SLOP SPLICER",
    "made_with_app": "xfgeujl3",
    "status": "active",
    "compile_ok": true,
    "tags": [],
    "parents": [],
    "author": "zazi5inxhmgi",
    "author_name": "ufffd",
    "author_url": "/u/ufffd",
    "created_at": "2026-06-18T20:33:33.830Z",
    "poster_url": "/posters/wa99dhz1.avif",
    "stats": {
      "slops": 1,
      "views": 167,
      "forks": 0
    },
    "self": "/api/v1/shaders/wa99dhz1",
    "isf": "/*{\n  \"DESCRIPTION\": \"Cymatic amethyst: hex crystal cluster with Chladni nodal lines and labyrinth ridges etched across violet facets, gold sand gathering on nodes, cyan glow where ridges pinch.\",\n  \"CATEGORIES\": [\"generative\"],\n  \"INPUTS\": [\n    { \"NAME\": \"speed\",  \"TYPE\": \"float\", \"DEFAULT\": 1.0,  \"MIN\": 0.0, \"MAX\": 3.0 },\n    { \"NAME\": \"hue\",    \"TYPE\": \"float\", \"DEFAULT\": 0.74, \"MIN\": 0.0, \"MAX\": 1.0 },\n    { \"NAME\": \"irid\",   \"TYPE\": \"float\", \"DEFAULT\": 1.0,  \"MIN\": 0.0, \"MAX\": 2.0 },\n    { \"NAME\": \"glowAmt\",\"TYPE\": \"float\", \"DEFAULT\": 1.0,  \"MIN\": 0.0, \"MAX\": 2.0 },\n    { \"NAME\": \"count\",  \"TYPE\": \"long\",  \"DEFAULT\": 7,    \"MIN\": 3,   \"MAX\": 9 }\n  ]\n}*/\n\n#define PI  3.14159265359\n#define TAU 6.28318530718\n#define GA  2.39996323\nconst float PERIOD = 16.0;\n\nvec3 pal(float t){ return 0.5 + 0.5*cos(TAU*(t + vec3(0.0, 0.33, 0.66))); }\n\nmat3 rotY(float a){ float c=cos(a), s=sin(a); return mat3(c,0,-s, 0,1,0, s,0,c); }\n\nmat3 align(vec3 d){\n  vec3 z = normalize(d);\n  vec3 up = abs(z.y) < 0.98 ? vec3(0.0,1.0,0.0) : vec3(1.0,0.0,0.0);\n  vec3 x = normalize(cross(up, z));\n  vec3 y = cross(z, x);\n  return mat3(x, y, z);\n}\n\nfloat sdHexPrism(vec3 p, vec2 h){\n  const vec3 k = vec3(-0.8660254, 0.5, 0.57735);\n  p = abs(p);\n  p.xy -= 2.0*min(dot(k.xy, p.xy), 0.0)*k.xy;\n  vec2 d = vec2(length(p.xy - vec2(clamp(p.x, -k.z*h.x, k.z*h.x), h.x))*sign(p.y - h.x),\n                p.z - h.y);\n  return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n}\n\nfloat crystal(vec3 q, float len, float rad){\n  float apex = len + rad*1.9;\n  float body = sdHexPrism(q - vec3(0.0, 0.0, apex*0.5), vec2(rad, apex*0.5));\n  float ax = apex - q.z;\n  float cone = length(q.xy) - max(0.0, ax)*0.60;\n  return max(body, cone);\n}\n\n// From Parent 2: fbm for labyrinth ridges\nfloat hash2(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); }\nfloat vnoise(vec2 p){\n  vec2 i = floor(p), f = fract(p);\n  f = f*f*(3.0 - 2.0*f);\n  float a = hash2(i), b = hash2(i+vec2(1,0)), c = hash2(i+vec2(0,1)), d = hash2(i+vec2(1,1));\n  return mix(mix(a,b,f.x), mix(c,d,f.x), f.y);\n}\nfloat fbm(vec2 p){\n  float s = 0.0, a = 0.5;\n  for(int i = 0; i < 4; i++){ s += a*vnoise(p); p = p*2.02 + 7.3; a *= 0.5; }\n  return s;\n}\n\n// From Parent 3: Chladni standing wave\nfloat chladni(vec2 p, float n, float m){\n  return cos(n*PI*p.x)*cos(m*PI*p.y) - cos(m*PI*p.x)*cos(n*PI*p.y);\n}\n\nfloat map(vec3 p){\n  float d = 1e9;\n  for(int i = 0; i < 9; i++){\n    if(i >= int(count)) break;\n    float fi = float(i);\n    float tilt = 0.10 + 0.62*fract(fi*0.37 + 0.13);\n    float az   = fi*GA;\n    vec3 dir = vec3(sin(tilt)*cos(az), cos(tilt), sin(tilt)*sin(az));\n    float len = 0.85 + 0.55*fract(fi*0.61);\n    float rad = 0.085 + 0.04*fract(fi*0.53);\n    vec3 base = dir*0.12;\n    vec3 q = (p - base) * align(dir);\n    d = min(d, crystal(q, len, rad));\n  }\n  return d;\n}\n\nvec3 normal(vec3 p){\n  vec2 e = vec2(0.0012, 0.0);\n  return normalize(vec3(\n    map(p+e.xyy) - map(p-e.xyy),\n    map(p+e.yxy) - map(p-e.yxy),\n    map(p+e.yyx) - map(p-e.yyx)));\n}\n\n// Surface texture combining Chladni + fbm ridges\nvec3 surfaceTex(vec3 p, vec3 n, float th, vec2 off){\n  // Project position onto facet plane using normal\n  vec3 u = normalize(abs(n.y) < 0.99 ? cross(n, vec3(0,1,0)) : cross(n, vec3(1,0,0)));\n  vec3 v = cross(n, u);\n  vec2 uv = vec2(dot(p, u), dot(p, v)) * 3.5;\n  \n  // Chladni pattern (Parent 3)\n  float n_mode = 3.0 + 1.6*cos(th);\n  float m_mode = 4.5 + 1.6*sin(th);\n  float chl = chladni(uv, n_mode, m_mode);\n  float chlAbs = abs(chl);\n  float sand = 0.04 / (chlAbs + 0.04);\n  sand = pow(sand, 2.3);\n  \n  // Fbm ridges (Parent 2)\n  float field = fbm(uv + off) + 0.35*fbm(uv*2.1 - off*1.6 + 4.0);\n  float rv = sin(field*14.0 - 2.0*th);\n  float ridge = abs(rv);\n  float line = 0.13 / (ridge*ridge + 0.010);\n  float pinchAmt = smoothstep(0.62, 1.05, fbm(uv*1.7 + off));\n  \n  // Blend palettes: violet amethyst + cyan ridges + gold sand\n  vec3 amethyst = pal(hue + 0.02*p.z);\n  vec3 cyanRidge = vec3(0.25, 0.95, 0.85);\n  vec3 magenta = vec3(1.0, 0.22, 0.55);\n  vec3 gold = vec3(1.0, 0.85, 0.52);\n  \n  vec3 col = amethyst * 0.3;\n  col += gold * sand * 0.8;\n  col += mix(cyanRidge, magenta, pinchAmt) * line * 0.4;\n  \n  return col;\n}\n\nvoid main(){\n  vec2 uv = (2.0*gl_FragCoord.xy - RENDERSIZE.xy) / RENDERSIZE.y;\n\n  float ph = fract(TIME * speed / PERIOD);\n  float th = TAU * ph;\n\n  mat3 spin = rotY(th);\n\n  vec3 ro = spin * vec3(0.0, 0.45, 2.35);\n  vec3 ta = vec3(0.0, 0.62, 0.0);\n  vec3 fw = normalize(ta - ro);\n  vec3 rt = normalize(cross(vec3(0,1,0), fw));\n  vec3 up = cross(fw, rt);\n  vec3 rd = normalize(uv.x*rt + uv.y*up + 2.0*fw);\n\n  // fbm orbiting offset (Parent 2 motion)\n  vec2 off = 0.42*vec2(cos(th), sin(th));\n\n  float t = 0.0;\n  float glow = 0.0;\n  bool hit = false;\n  for(int i = 0; i < 90; i++){\n    vec3 p = ro + rd*t;\n    float d = map(p);\n    glow += glowAmt * 0.012 / (1.0 + 28.0*d*d);\n    if(d < 0.0006*t){ hit = true; break; }\n    t += d*0.8;\n    if(t > 8.0) break;\n  }\n\n  vec3 col = vec3(0.0);\n  vec3 bg = mix(vec3(0.02,0.015,0.045), vec3(0.005,0.005,0.02), uv.y*0.5+0.5);\n  col = bg;\n\n  if(hit){\n    vec3 p = ro + rd*t;\n    vec3 n = normal(p);\n    float fres = pow(1.0 - max(0.0, dot(n, -rd)), 3.0);\n    \n    // Surface texture from blended parents\n    vec3 surfCol = surfaceTex(p, n, th, off);\n    \n    // Fresnel edge: amethyst + iridescence\n    float iridShift = irid * (0.5 + 0.5*sin(p.z*8.0 + th*3.0));\n    vec3 fresCol = pal(hue + iridShift);\n    vec3 edgeCol = mix(pal(hue), fresCol, fres) * fres * 2.0;\n    \n    // Inner glow (violet)\n    vec3 innerGlow = pal(hue + 0.05) * 0.15;\n    \n    col = surfCol + innerGlow + edgeCol;\n  }\n\n  // Volumetric glow from Parent 1\n  vec3 glowCol = pal(hue + 0.1) * glow;\n  col += glowCol;\n\n  col = col / (1.0 + col);\n  col = pow(col, vec3(0.85));\n  gl_FragColor = vec4(col, 1.0);\n}"
  }
}