{
  "license": "CC0-1.0",
  "shader": {
    "id": "28djpvdl",
    "title": "Procedural Matrix Digital Rain (falling)",
    "license": "CC0-1.0",
    "provenance_type": "bred",
    "made_with": "Claude Code",
    "status": "active",
    "compile_ok": true,
    "tags": [
      "2D",
      "Matrix",
      "rain",
      "generator"
    ],
    "parents": [
      "ww0xjfld"
    ],
    "author": "zazi5inxhmgi",
    "author_name": "ufffd",
    "author_url": "/u/ufffd",
    "created_at": "2026-07-15T18:07:04.274Z",
    "poster_url": "/posters/28djpvdl.avif",
    "stats": {
      "slops": 0,
      "views": 153,
      "forks": 1
    },
    "self": "/api/v1/shaders/28djpvdl",
    "isf": "/*{\n    \"DESCRIPTION\": \"Procedural Matrix Digital Rain — trails now stream up behind the falling heads, and the fade drops out the bottom instead of the top.\",\n    \"CREDIT\": \"ChatGPT, direction fix by Claude\",\n    \"CATEGORIES\": [\n        \"Generator\"\n    ],\n    \"INPUTS\": [\n        {\n            \"NAME\":\"speed\",\n            \"TYPE\":\"float\",\n            \"DEFAULT\":1.0,\n            \"MIN\":0.0,\n            \"MAX\":4.0\n        },\n        {\n            \"NAME\":\"density\",\n            \"TYPE\":\"float\",\n            \"DEFAULT\":1.0,\n            \"MIN\":0.5,\n            \"MAX\":3.0\n        },\n        {\n            \"NAME\":\"glow\",\n            \"TYPE\":\"float\",\n            \"DEFAULT\":1.2,\n            \"MIN\":0.0,\n            \"MAX\":3.0\n        },\n        {\n            \"NAME\":\"brightness\",\n            \"TYPE\":\"float\",\n            \"DEFAULT\":1.0,\n            \"MIN\":0.2,\n            \"MAX\":3.0\n        }\n    ]\n}*/\n\nfloat hash(float n)\n{\n    return fract(sin(n)*43758.5453123);\n}\n\n// 5x7 procedural glyph\nfloat glyph(vec2 uv,float id)\n{\n    uv*=vec2(5.0,7.0);\n\n    vec2 cell=floor(uv);\n\n    float n=hash(dot(cell,vec2(17.0,31.0))+id*83.0);\n\n    return step(0.55,n);\n}\n\nvoid main()\n{\n    vec2 uv=isf_FragNormCoord;\n\n    uv.x*=RENDERSIZE.x/RENDERSIZE.y;\n\n    float cols=90.0*density;\n\n    vec2 grid=vec2(cols,floor(cols*1.8));\n\n    vec2 g=uv*grid;\n\n    vec2 cell=floor(g);\n\n    vec2 local=fract(g);\n\n    //------------------------------------\n    // randomize each column\n    //------------------------------------\n\n    float column=floor(cell.x);\n\n    float rnd=hash(column);\n\n    float speedMul=mix(.5,2.2,rnd);\n\n    float t=TIME*speed*speedMul;\n\n    //------------------------------------\n    // falling position\n    //------------------------------------\n\n    float y=mod(cell.y+t*20.0+rnd*300.0,grid.y);\n\n    float head=hash(column*9.0)*grid.y;\n\n    // isf_FragNormCoord is y-up, so cells above the head are the ones the\n    // drop has already passed. Measuring y-head (not head-y) puts the trail\n    // there instead of below the head.\n    float trail=mod(y-head+grid.y,grid.y);\n\n    //------------------------------------\n    // character\n    //------------------------------------\n\n    // floor(t) so glyphs flip in place rather than sliding the whole field\n    float charID=floor(mod(cell.y+floor(t*7.0)+rnd*100.0,96.0));\n\n    float pix=glyph(local,charID);\n\n    //------------------------------------\n    // fade trail\n    //------------------------------------\n\n    float fade=exp(-trail*0.12);\n\n    //------------------------------------\n    // bright leading character\n    //------------------------------------\n\n    float leader=smoothstep(1.5,0.0,trail);\n\n    //------------------------------------\n    // random flicker\n    //------------------------------------\n\n    float flicker=.6+.4*sin(TIME*20.0+column*3.1+cell.y);\n\n    //------------------------------------\n    // color\n    //------------------------------------\n\n    vec3 green=vec3(0.05,1.0,0.15);\n\n    vec3 color=green*pix*fade*flicker*brightness;\n\n    color+=vec3(1.0)*leader*pix;\n\n    //------------------------------------\n    // bloom\n    //------------------------------------\n\n    color+=green*leader*glow;\n\n    //------------------------------------\n    // subtle fog — dissolve toward the bottom, where the rain exits\n    //------------------------------------\n\n    color*=1.0-smoothstep(.0,1.2,1.0-uv.y);\n\n    gl_FragColor=vec4(color,1.0);\n}\n"
  }
}