{
  "name": "Lava",
  "dimension": "text",
  "slot": "action_bar",
  "width": 256,
  "height": 128,
  "textBaseline": 128,
  "placement": {
    "x": 0,
    "y": 0
  },
  "shapes": [],
  "texts": [],
  "heads": [],
  "images": [],
  "bars": [],
  "triggers": [],
  "effect": {
    "glsl": "float lavaSurface(Fx f) {\n    float x = f.o.x + f.q.x;\n    return f.size.y * (1.0 - 0.52 - 0.05 * sin(f.t * 0.6))\n         + sin(x * 0.4 - f.t * 1.3) * 0.6\n         + sin(x * 0.17 + f.t * 0.8) * 0.5;\n}\nvec4 effect(Fx f) {\n    float a = G(f.p);\n    float surf = lavaSurface(f);\n    float depth = f.q.y - surf;\n    vec2 g = floor(f.g);\n    vec3 c;\n    if (depth < 0.0) {\n        // Basalt above the lava, warmed from below.\n        c = G(f.p - vec2(0.0, 1.0)) < 0.5 ? vec3(0.4, 0.36, 0.35) : vec3(0.24, 0.21, 0.21);\n        c = mix(c, vec3(0.55, 0.2, 0.08), clamp(1.0 + depth / 2.0, 0.0, 1.0));\n    } else {\n        float n = vnoise(vec2(g.x * 0.35 + f.t * 0.4, g.y * 0.5 - f.t * 0.25));\n        c = mix(vec3(1.0, 0.42, 0.04), vec3(0.78, 0.12, 0.02), clamp(depth / 5.0, 0.0, 1.0));\n        c = mix(c, vec3(1.0, 0.8, 0.22), smoothstep(0.55, 0.8, n));\n        if (n < 0.22) c = mix(c, vec3(0.35, 0.08, 0.03), 0.6);\n        if (depth < 1.0) c = vec3(1.0, 0.92, 0.5);\n    }\n    vec4 col = over(vec4(c, a), vec4(0.06, 0.02, 0.01, G(f.p - 1.0) * 0.85));\n    // A bubble swells at the surface and pops, one letter at a time.\n    float clock = f.t * 0.8 + h2(f.o) * 9.0;\n    float k = floor(clock);\n    float life = fract(clock);\n    if (h3(vec3(f.o, k)) > 0.45) {\n        float bx = floor(h3(vec3(f.o, k + 1.0)) * max(f.w - 1.0, 1.0)) + 0.5;\n        float r = life < 0.8 ? life / 0.8 * 1.4 : 0.0;\n        float sy = floor(lavaSurface(f)) + 0.5;\n        float d = length(vec2(f.q.x - bx, (f.q.y - sy) * 1.3));\n        if (r > 0.3 && d < r && f.q.y <= sy) col = over(vec4(1.0, 0.68, 0.16, d > r - 0.8 ? 1.0 : 0.85), col);\n        // The pop: two sparks thrown up.\n        if (life >= 0.8) {\n            float up = (life - 0.8) / 0.2 * 3.0;\n            if (abs(f.q.y - (sy - 1.0 - floor(up))) < 0.5 && abs(abs(f.q.x - bx) - 1.0 - floor(up * 0.5)) < 0.5) {\n                col = over(vec4(1.0, 0.85, 0.35, 1.0 - (life - 0.8) / 0.2), col);\n            }\n        }\n    }\n    return col;\n}\n",
    "pad": [
      0,
      2,
      1,
      1
    ],
    "prompt": "",
    "preset": "moltentank",
    "sample": "LAVA"
  }
}