{
  "name": "Towering Thundercloud",
  "dimension": "3d",
  "slot": "action_bar",
  "width": 256,
  "height": 128,
  "textBaseline": 128,
  "placement": {
    "x": 0,
    "y": 0
  },
  "shapes": [],
  "texts": [],
  "heads": [],
  "images": [],
  "bars": [],
  "triggers": [],
  "world": {
    "glsl": "float tcSoft(float a,float b,float k) {\n    float h=max(k-abs(a-b),0.0)/k;\n    return min(a,b)-h*h*k*0.25;\n}\nfloat tcEll(vec3 p,vec3 c,vec3 r) { return (length((p-c)/r)-1.0)*min(r.x,min(r.y,r.z)); }\nfloat tcCloud(vec3 p,float time) {\n    p.x+=0.008*sin(time*0.55+p.y*6.0); p.z+=0.006*cos(time*0.4+p.x*8.0);\n    float d=tcEll(p,vec3(0.0,0.545,0.0),vec3(0.33,0.19,0.28));\n    d=tcSoft(d,tcEll(p,vec3(-0.235,0.535,0.025),vec3(0.16,0.145,0.19)),0.045);\n    d=tcSoft(d,tcEll(p,vec3(0.23,0.54,0.0),vec3(0.165,0.16,0.18)),0.045);\n    d=tcSoft(d,tcEll(p,vec3(-0.12,0.68,0.005),vec3(0.175,0.18,0.18)),0.042);\n    d=tcSoft(d,tcEll(p,vec3(0.085,0.725,0.025),vec3(0.18,0.17,0.18)),0.04);\n    d=tcSoft(d,tcEll(p,vec3(0.0,0.54,-0.18),vec3(0.24,0.155,0.155)),0.04);\n    d=tcSoft(d,tcEll(p,vec3(-0.04,0.535,0.18),vec3(0.24,0.165,0.165)),0.04);\n    if(d<0.04) d+=(rpw_noise(p*25.0+vec3(time*0.06,0.0,0.0))-0.5)*0.018;\n    return max(d,0.385-p.y);\n}\nvec2 tcSegment(vec3 ro,vec3 rd,vec3 a,vec3 b) {\n    vec3 v=b-a; vec3 w=ro-a;\n    float vv=dot(v,v); float vr=dot(v,rd);\n    float s=clamp((dot(w,v)-dot(w,rd)*vr)/max(vv-vr*vr,0.000001),0.0,1.0);\n    vec3 q=a+s*v; float t=max(0.0,dot(q-ro,rd));\n    return vec2(length(ro+t*rd-q),t);\n}\nvec3 tcNode(float k,float seed) {\n    float f=k/11.0;\n    vec2 endp=vec2(rpw_hash(vec3(seed,5.0,3.0)),rpw_hash(vec3(seed,8.0,7.0)))*2.0-1.0;\n    vec2 j=vec2(rpw_hash(vec3(k,seed,1.0)),rpw_hash(vec3(k,seed,2.0)))*2.0-1.0;\n    vec2 xz=endp*(0.04+0.06*f)+j*(0.025+0.065*sin(f*3.14159));\n    float y=mix(0.49,-0.988,f);\n    float limit=sqrt(max(0.0001,0.996*0.996-y*y));\n    xz*=min(1.0,limit/max(length(xz),0.0001));\n    return vec3(xz.x,y,xz.y);\n}\nvec4 object(vec3 ro,vec3 rd,float t0,float t1,float time,vec3 light,inout float depth) {\n    float cycle=floor((time+0.13)/2.8); float phase=mod(time+0.13,2.8);\n    float flash=(1.0-smoothstep(0.02,0.10,phase))+0.8*smoothstep(0.11,0.13,phase)*(1.0-smoothstep(0.17,0.26,phase));\n    vec4 cloud=vec4(0.0,0.0,0.0,t1+1.0);\n    vec3 co=ro-vec3(0.0,0.62,0.0);\n    float cb=dot(co,rd); float ch=cb*cb-dot(co,co)+0.45*0.45;\n    if(ch>0.0) {\n        float lo=max(t0,-cb-sqrt(ch)); float hi=min(t1,-cb+sqrt(ch));\n        float ct=lo;\n        for(int i=0;i<56;i++) {\n            if(ct>hi) break;\n            vec3 p=ro+rd*ct; float d=tcCloud(p,time);\n            if(d<0.0009) {\n                vec2 e=vec2(0.006,-0.006);\n                vec3 n=e.xyy*tcCloud(p+e.xyy,time)+e.yyx*tcCloud(p+e.yyx,time)+e.yxy*tcCloud(p+e.yxy,time)+e.xxx*tcCloud(p+e.xxx,time);\n                cloud=vec4(normalize(n),ct); break;\n            }\n            ct+=max(d*0.8,0.0007);\n        }\n    }\n    vec3 sum=vec3(0.0); float alpha=0.0; float first=t1;\n    if(cloud.w<=t1) {\n        vec3 p=ro+rd*cloud.w; vec3 n=cloud.xyz;\n        float a=rpw_noise(p*25.0+vec3(time*0.07,0.0,0.0));\n        float b=rpw_noise(p*65.0+vec3(time*0.05,0.0,0.0));\n        float diffuse=max(0.0,dot(n,normalize(vec3(-0.4,0.8,0.35))));\n        float lum=0.09+0.19*diffuse;\n        lum*=0.78+0.30*a+0.12*b;\n        lum*=mix(0.56,1.0,smoothstep(0.39,0.7,p.y));\n        sum=vec3(lum*0.87,lum*0.94,lum*1.07)*light;\n        float glow=exp(-length((p-vec3(0.025,0.49,0.02))*vec3(3.8,5.5,3.8)));\n        sum+=flash*glow*vec3(1.5,1.8,2.6)*(0.85+0.15*a);\n        alpha=1.0; first=cloud.w;\n    }\n    vec3 safe=vec3(rd.x>=0.0?max(rd.x,0.00001):min(rd.x,-0.00001),rd.y>=0.0?max(rd.y,0.00001):min(rd.y,-0.00001),rd.z>=0.0?max(rd.z,0.00001):min(rd.z,-0.00001));\n    vec3 inv=1.0/safe;\n    vec3 mn=(vec3(-0.345,-0.994,-0.315)-ro)*inv;\n    vec3 mx=(vec3(0.345,0.388,0.315)-ro)*inv;\n    vec3 en=min(mn,mx); vec3 ex=max(mn,mx);\n    float start=max(t0,max(en.x,max(en.y,en.z)));\n    float end=min(min(t1,cloud.w),min(ex.x,min(ex.y,ex.z)));\n    vec3 rain=vec3(0.0); float ra=0.0;\n    if(start<end) {\n        vec3 cellSize=vec3(0.034,0.23,0.034);\n        vec3 shift=vec3(0.0,time*1.65,0.0);\n        vec3 pos=ro+rd*(start+0.00001)+shift;\n        vec3 cell=floor(pos/cellSize);\n        vec3 sg=sign(safe); vec3 side=(cell+max(sg,vec3(0.0)))*cellSize;\n        vec3 next=(side-shift-ro)*inv; vec3 delta=abs(cellSize*inv);\n        for(int i=0;i<48;i++) {\n            float h=rpw_hash(cell);\n            float h2=fract(h*31.713); float h3=fract(h*79.173);\n            vec3 a=(cell+vec3(0.18+0.64*h,0.025+0.62*h3,0.18+0.64*h2))*cellSize-shift;\n            vec3 b=a+vec3(0.001,0.045+0.035*h2,0.0);\n            if(dot(a.xz/vec2(0.34,0.31),a.xz/vec2(0.34,0.31))<1.0 && a.y<0.385 && b.y>-.988 && dot(a,a)<0.988 && dot(b,b)<0.988) {\n                b.y=min(b.y,0.385); a.y=max(a.y,-0.988);\n                vec2 ds=tcSegment(ro,rd,a,b);\n                if(ds.y>=start && ds.y<=end) {\n                    float cover=(1.0-smoothstep(0.00055,0.0019,ds.x))*(0.32+0.27*h);\n                    vec3 col=vec3(0.56,0.69,0.82)*(0.85+flash*0.20);\n                    rain+=(1.0-ra)*cover*col; ra+=(1.0-ra)*cover;\n                    if(cover>0.1) first=min(first,ds.y);\n                }\n            }\n            float nt=min(next.x,min(next.y,next.z)); if(nt>end || ra>0.95) break;\n            if(next.x<=next.y && next.x<=next.z) {cell.x+=sg.x;next.x+=delta.x;}\n            else if(next.y<=next.z) {cell.y+=sg.y;next.y+=delta.y;}\n            else {cell.z+=sg.z;next.z+=delta.z;}\n        }\n    }\n    sum=rain+sum*(1.0-ra); alpha=ra+alpha*(1.0-ra);\n    if(flash>0.001) {\n        vec2 bolt=vec2(10.0,t1); vec2 branch=vec2(10.0,t1);\n        for(int i=0;i<11;i++) {\n            vec3 a=tcNode(float(i),cycle); vec3 b=tcNode(float(i+1),cycle);\n            vec2 ds=tcSegment(ro,rd,a,b); if(ds.x<bolt.x) bolt=ds;\n            if(i==3 || i==5 || i==7) {\n                float dir=mod(float(i),4.0)<2.0?-1.0:1.0;\n                vec3 c=b+vec3(dir*0.11,-0.11,0.055); vec3 e=c+vec3(dir*0.065,-0.17,-0.04);\n                ds=tcSegment(ro,rd,b,c); if(ds.x<branch.x) branch=ds;\n                ds=tcSegment(ro,rd,c,e); if(ds.x<branch.x) branch=ds;\n            }\n        }\n        float core=1.0-smoothstep(0.0018,0.005,bolt.x);\n        float br=1.0-smoothstep(0.0006,0.0027,branch.x);\n        float halo=exp(-bolt.x*105.0)*0.48+exp(-branch.x*150.0)*0.13;\n        float vis=bolt.y<cloud.w+0.005?1.0:0.0;\n        float ba=clamp((core+br*0.75+halo)*flash*vis,0.0,1.0);\n        vec3 bc=vec3(0.36,0.54,1.0)*halo*2.2+vec3(1.8,1.95,2.2)*(core+br*0.65);\n        sum=sum*(1.0-ba)+bc*flash*vis; alpha=ba+alpha*(1.0-ba);\n        if(ba>0.12) first=min(first,min(bolt.y,branch.y));\n    }\n    depth=clamp(first,t0,t1);\n    return vec4(sum/max(alpha,0.0001),clamp(alpha,0.0,1.0));\n}",
    "prompt": "a giant dark thundercloud hanging in the sky with heavy rain pouring down from its flat base all the way to the ground, and every couple of seconds a jagged, branching lightning bolt strikes from the cloud down to the ground with a bright flash that lights the cloud up from inside. LAYOUT: the object is placed 16 blocks across with its bottom on the ground, so the cloud is a wide puffy mass about 6 blocks across (radius ~0.38) filling the TOP third of the sphere (centred around y = 0.55), and the rain is a column of fine bright falling streaks under it that fills the space from the cloud base down to the bottom of the sphere (y = -1). Lightning bolts run from the cloud base to y = -1, flicker for a fraction of a second, and strike at a different spot each time. Keep everything inside the unit sphere.",
    "size": 16,
    "summary": "A dark, slowly billowing cloud hangs above heavy falling rain, with branching lightning striking changing spots every 2.8 seconds and flashing through the cloud from within."
  }
}