{
  "license": "CC0-1.0",
  "shader": {
    "id": "mfupgrz0",
    "title": "Plasma Weave",
    "license": "CC0-1.0",
    "provenance_type": "witnessed_generation",
    "made_with": "glslop",
    "status": "active",
    "compile_ok": true,
    "render_hash": "00007ec3ff080000",
    "tags": [
      "volumetric",
      "raymarch",
      "plasma",
      "torus",
      "filaments",
      "loop"
    ],
    "parents": [],
    "author": "zazi5inxhmgi",
    "author_name": "ufffd",
    "author_url": "/u/ufffd",
    "created_at": "2026-07-21T01:54:30.528Z",
    "poster_url": "/posters/mfupgrz0.avif",
    "stats": {
      "slops": 0,
      "views": 166,
      "forks": 1
    },
    "self": "/api/v1/shaders/mfupgrz0",
    "isf": "/*{\n  \"DESCRIPTION\": \"Volumetric plasma torus: a raymarched emissive ring of twisted filaments, lit by glow x transmittance so it reads as real fog rather than see-through foam. Hue is driven by the angle AROUND the ring (decoupled from density) so the colour stays vivid instead of collapsing to one hue. Seamless 12s loop.\",\n  \"CREDIT\": \"glslop agent\",\n  \"CATEGORIES\": [\"volumetric\", \"raymarch\", \"plasma\", \"torus\", \"loop\"],\n  \"INPUTS\": [\n    { \"NAME\": \"density\",  \"TYPE\": \"float\", \"DEFAULT\": 1.0,  \"MIN\": 0.3, \"MAX\": 2.2 },\n    { \"NAME\": \"twist\",    \"TYPE\": \"float\", \"DEFAULT\": 1.0,  \"MIN\": 0.0, \"MAX\": 2.5 },\n    { \"NAME\": \"hueSpread\",\"TYPE\": \"float\", \"DEFAULT\": 1.0,  \"MIN\": 0.0, \"MAX\": 2.0 },\n    { \"NAME\": \"exposure\", \"TYPE\": \"float\", \"DEFAULT\": 1.0,  \"MIN\": 0.4, \"MAX\": 2.5 },\n    { \"NAME\": \"speed\",    \"TYPE\": \"float\", \"DEFAULT\": 1.0,  \"MIN\": 0.0, \"MAX\": 3.0 }\n  ]\n}*/\n\n#define TAU 6.28318530718\n#define STEPS 96\nconst float PERIOD = 12.0;\n\nmat2 rot(float a){ float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }\n\n// cheap trig-fbm: loop-safe (only integer harmonics of th enter via the orbiting warp)\nfloat wobble(vec3 p, float th){\n  vec3 q = p + vec3(cos(th), sin(th), cos(th)) * 0.35;\n  float f  = sin(q.x * 2.7) * sin(q.y * 3.1) * sin(q.z * 2.3);\n  f += 0.5  * sin(q.x * 5.9 + q.z * 1.7) * sin(q.y * 6.3);\n  f += 0.25 * sin(q.y * 12.1 + q.x * 3.3) * sin(q.z * 11.4);\n  return f * 0.571;\n}\n\n// density of the filament ring at p; also returns the angle around the ring in ang\nfloat field(vec3 p, float th, out float ang){\n  ang = atan(p.z, p.x);\n  vec2 cs = vec2(length(p.xz) - 1.0, p.y);       // torus cross-section coords\n  cs = rot(ang * 3.0 * twist + th) * cs;         // twist the cross-section around the ring\n\n  float w = wobble(p * 2.1, th);\n  float tube = length(cs) - (0.15 + 0.055 * w);\n  float d = smoothstep(0.055, -0.02, tube);\n\n  // carve discrete filaments running along the tube\n  float fil = 0.5 + 0.5 * sin(atan(cs.y, cs.x) * 6.0 + ang * 9.0 + w * 2.4);\n  fil = pow(fil, 3.0);\n  return d * (0.12 + 0.88 * fil);\n}\n\n// cohesive 2-tone: deep cyan-teal through hot magenta, with ember-orange cores added on top\nvec3 pal(float t){\n  return mix(vec3(0.00, 0.48, 0.85), vec3(1.00, 0.06, 0.42), 0.5 + 0.5 * cos(TAU * t));\n}\n\n// time-independent dither: breaks the fixed-step banding without touching the loop\nfloat hash12(vec2 p){\n  return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);\n}\n\nvoid main(){\n  vec2 uv = (gl_FragCoord.xy - 0.5 * RENDERSIZE.xy) / RENDERSIZE.y;\n\n  float ph = fract(TIME * speed / PERIOD);\n  float th = TAU * ph;\n\n  // camera OUTSIDE the volume, above the ring plane looking down at it\n  vec3 ro = vec3(0.0, 1.62, 4.16);\n  vec3 rd = normalize(vec3(uv, -1.85));\n  // tilt DOWN toward the origin, then spin the whole scene one full turn per loop\n  rd.yz = rot(0.371) * rd.yz;\n  ro.xz = rot(th) * ro.xz;\n  rd.xz = rot(th) * rd.xz;\n\n  float dt = 0.034;\n  float t = 2.7;\n\n  vec3 col = vec3(0.0);\n  float trans = 1.0;\n\n  for (int i = 0; i < STEPS; i++){\n    vec3 p = ro + rd * t;\n    float ang;\n    float d = field(p, th, ang) * density;\n    if (d > 0.002){\n      // hue from ring angle + a slow phase sweep: decoupled from density on purpose\n      float hueArg = ang / TAU * hueSpread + 0.35 * p.y + ph;\n      vec3 emit = pal(hueArg);\n      emit += vec3(1.0, 0.50, 0.15) * smoothstep(0.55, 1.0, d) * 1.3;   // ember cores\n      col += emit * d * trans * dt * 8.0;\n      trans *= exp(-d * dt * 15.0);\n      if (trans < 0.01) break;\n    }\n    t += dt;\n    if (t > 5.6) break;\n  }\n\n  // faint halo so the ring sits in space instead of on flat black\n  float halo = exp(-length(uv) * 2.6);\n  col += vec3(0.05, 0.03, 0.10) * halo;\n\n  col *= exposure * 1.25;\n  col = 1.0 - exp(-col);                 // soft knee: keeps colour in the highlights\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
    }
  }
}