-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.bundle.js.map
1 lines (1 loc) · 29.8 KB
/
example.bundle.js.map
1
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/example.coffee","webpack:///./src/shader-box.coffee","webpack:///./src/vertex_shader.glsl","webpack:///./src/examples/flame-eye.glsl","webpack:///./src/examples/rorschach-test.glsl","webpack:///./src/examples/image.glsl"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","Box","Shader","box","draw","frag_shader","frag_shader2","frag_shader3","mouse","shaderA","shaderB","shaderC","canvas","window","resize","clearColor","grid","context","antialias","depth","source","uniforms","iTime","type","textureUrl","pos","add","x","y","addEventListener","e","clientX","clientY","focus","requestAnimationFrame","clear","default_vertex_shader","[object Object]","opt","j","k","ref","ref1","setViewport","this","shaders","gl","getContext","alert","push","bindFramebuffer","FRAMEBUFFER","verts","buffer","mx","my","sx","sy","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","Float32Array","STATIC_DRAW","u_move","origin","state","stage","u_scale","len","results","shader","width","clientWidth","height","clientHeight","viewport","length","setUvBuffer","index","init","COLOR_BUFFER_BIT","DEPTH_BUFFER_BIT","_u","u","v_buffer","Error","vert_buffer","useProgram","program","updateUvBuffer","uniform2f","_uniforms","isArray","set","loc","Array","vertexAttribPointer","a_position","FLOAT","enableVertexAttribArray","uv_buffer","a_texture","texture","bindTexture","TEXTURE_2D","uniform1i","u_texture","drawArrays","TRIANGLE_STRIP","code","uv","nh","nw","r_x","image","val","setVertBuffer","createProgram","getAttribLocation","getUniformLocation","createTexture","texImage2D","RGBA","UNSIGNED_BYTE","Uint8Array","Image","crossOrigin","src","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","LINEAR","TEXTURE_MAG_FILTER","match","vert","frag","fs","prog","vs","createShader","FRAGMENT_SHADER","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","getShaderSource","VERTEX_SHADER","attachShader","linkProgram","getProgramParameter","LINK_STATUS","getProgramInfoLog","opts"],"mappings":"aACA,IAAAA,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,GAAA,EACAH,QAAA,IAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,EAAA,CAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,YAAA,CAAwDC,MAAA,WAExDP,OAAAC,eAAAb,EAAA,cAAiDmB,OAAA,KAQjDrB,EAAAsB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAArB,EAAAqB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAGA,GAFA1B,EAAAkB,EAAAO,GACAX,OAAAC,eAAAU,EAAA,WAAyCT,YAAA,EAAAK,UACzC,EAAAE,GAAA,iBAAAF,EAAA,QAAAM,KAAAN,EAAArB,EAAAU,EAAAe,EAAAE,EAAA,SAAAA,GAAgH,OAAAN,EAAAM,IAAqBC,KAAA,KAAAD,IACrI,OAAAF,GAIAzB,EAAA6B,EAAA,SAAA1B,GACA,IAAAS,EAAAT,KAAAqB,WAC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,QAAU,CAACkC,MAAIC,yBC9PtBlC,EAAAD,QAAA6L,IAAA,oPCAA5L,EAAAD,QAAA6L,IAAA,khFCAA5L,EAAAD,QAAA6L,IAAA,81DCAA5L,EAAAD,QAAA6L,IAAA","file":"example.bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","\n{Box,Shader} = require './shader-box.coffee'\nfrag_shader = require('./examples/flame-eye.glsl')()\nfrag_shader2 = require('./examples/rorschach-test.glsl')()\n# frag_shader3 = require('./examples/sunrise.glsl')()\nfrag_shader3 = require('./examples/image.glsl')()\n\nbox = new Box\n\tcanvas: window.canvas #canvas element to get context from\n\tresize: true #auto resize on window.resize\n\tclearColor: [0.0, 0.0, 0.0, 1.0]\n\tgrid: [1,1] #x and y size of a grid, if you want to display more than one shader like in this example. default is 1 x 1\n\tcontext:\n\t\tantialias: true\n\t\tdepth: false\n\n\nshaderA = new Shader\n\tsource: frag_shader #you can use webpack and require your shaders easy with a glsl or raw loader, look in the webpack.config.js for more\n\tuniforms:\n\t\tiTime:\n\t\t\ttype:'1f'\n\t\t\tvalue: 0.4\n\n\nshaderB = new Shader\n\tsource: frag_shader2 #you can use webpack and require your shaders easy with a glsl or raw loader, look in the webpack.config.js for \n\tuniforms:\n\t\tiTime:\n\t\t\ttype:'1f'\n\t\t\tvalue: 0.4\n\n\n# shaderC = new Shader\n# \tsource: frag_shader3 #you can use webpack and require your shaders easy with a glsl or raw loader, look in the webpack.config.js for \n# \tuniforms:\n# \t\tiTime:\n# \t\t\ttype:'1f'\n# \t\t\tvalue: 0.4\n\nshaderC = new Shader\n\tsource: frag_shader3 #you can use webpack and require your shaders easy with a glsl or raw loader, look in the webpack.config.js for more\n\ttextureUrl: './src/star.jpeg'\n\tuniforms:\n\t\tpos: #uniform name\n\t\t\ttype:'2fv' # setter = @gl[\"uniform\"+type]\n\t\t\tvalue: [0.4,0.4]\n\t\tiTime:\n\t\t\ttype:'1f'\n\t\t\tvalue: 0.4\n\n\n# box.add(shaderA).add(shaderB)\nbox.add(shaderC)\nmouse = {x:0,y:0}\n\nwindow.addEventListener 'mousemove', (e)=>\n\tmouse.x = e.clientX\n\tmouse.y = e.clientY\n\n\n# set box.focus to index of the grid, eg if grid is [3,1] focus can be -1 (display all shaders), 0 ,1, or 2\nwindow.addEventListener 'click', (e)=>\n\tbox.focus += 1\n\tif box.focus == 2\n\t\tbox.focus = -1\n\ndraw = (t)->\n\trequestAnimationFrame(draw)\n\tshaderA.uniforms.iTime.value = t*.001\n\tshaderB.uniforms.iTime.value = t*.001\n\tshaderC.uniforms.iTime.value = t*.001\n\t# shaderC.uniforms.iTime.value = t+4242\n\t# shaderC.uniforms.pos.value[0] = 1 - (mouse.x / window.innerWidth)\n\t# shaderC.uniforms.pos.value[1] = mouse.y / window.innerHeight\n\tbox\n\t\t.clear()\n\t\t# .draw(shaderA)\n\t\t# .draw(shaderB)\n\t\t.draw(shaderC)\n\n\n\ndraw(0)","default_vertex_shader = require('./vertex_shader.glsl')()\nclass Box\n\tconstructor: (opt)->\n\t\t@canvas = opt.canvas\n\t\t@grid = opt.grid || [1,1]\n\t\t@shaders = []\n\t\t@pos = []\n\t\t@gl = @canvas.getContext \"experimental-webgl\",(opt.context or {antialias:true,depth:false})\n\t\tif !@gl\n\t\t\talert 'failed to start webgl :('\n\t\t\n\t\t@focus = -1\n\t\t@setViewport()\n\t\tif opt.resize then window.addEventListener 'resize',@setViewport\n\t\tif opt.clearColor\n\t\t\t@gl.clearColor(opt.clearColor[0], opt.clearColor[1], opt.clearColor[2], opt.clearColor[3])\n\t\telse \n\t\t\t@gl.clearColor(0,0,0,1)\n\t\n\n\t\t\n\t\tfor y in [0...@grid[1]]\n\t\t\tfor x in [0...@grid[0]]\n\t\t\t\t@pos.push {x,y}\n\t\t\t\n\n\t\t@gl.bindFramebuffer(@gl.FRAMEBUFFER,null)\n\n\n\tcreateBuffer: (x,y,verts)->\n\t\tbuffer = @gl.createBuffer()\n\t\t@gl.bindBuffer @gl.ARRAY_BUFFER,buffer\n\t\t@gl.bufferData @gl.ARRAY_BUFFER,new Float32Array(verts),@gl.STATIC_DRAW\n\t\t\n\t\tmx = -@grid[0]+1+x*2\n\t\tmy = @grid[1]-1-y*2\n\t\t\n\t\tbuffer.u_move =\n\t\t\torigin: [mx,my]\n\t\t\tstate: [mx,my]\n\t\t\tstage: [mx,my]\n\t\t\n\t\tsx = 1 / @grid[0]\n\t\tsy = 1 / @grid[1]\n\t\t\n\t\tbuffer.u_scale =\n\t\t\torigin: [sx,sy]\n\t\t\tstate: [sx,sy]\n\t\t\tstage: [sx,sy]\n\t\t\n\t\treturn buffer\n\n\n\tsetViewport: =>\n\t\t@canvas.width = @width = @canvas.clientWidth\n\t\t@canvas.height = @height = @canvas.clientHeight\n\t\t@gl.viewport(0, 0, @width, @height)\n\t\tfor shader in @shaders\n\t\t\tshader.setUvBuffer(shader.index)\n\n\n\tadd: (shader)->\n\n\t\tshader.init(@,@shaders.length)\n\t\t@shaders.push shader\n\t\treturn @\n\n\n\tclear: ()->\n\t\t@gl.clear(@gl.COLOR_BUFFER_BIT | @gl.DEPTH_BUFFER_BIT)\n\t\treturn @\n\t\n\n\tdraw: (shader)->\n\t\tif !shader.gl\n\t\t\tthrow new Error 'shader has not been added.'\n\t\ti = i || 0\n\t\tv_buffer = shader.vert_buffer\n\t\t@gl.useProgram shader.program\n\t\tshader.updateUvBuffer()\n\n\n\t\tif @focus >= 0\n\t\t\tif shader.index == @focus\n\t\t\t\tv_buffer.u_move.state[0] = v_buffer.u_move.state[1] = 0\n\t\t\t\tv_buffer.u_scale.state[0] = v_buffer.u_scale.state[1] = 1\n\t\t\telse\n\t\t\t\tv_buffer.u_scale.state[0] = v_buffer.u_scale.state[1] = 0\n\t\telse\n\t\t\tv_buffer.u_move.state[0] = v_buffer.u_move.origin[0]\n\t\t\tv_buffer.u_move.state[1] = v_buffer.u_move.origin[1]\n\t\t\tv_buffer.u_scale.state[0] = v_buffer.u_scale.origin[0]\n\t\t\tv_buffer.u_scale.state[1] = v_buffer.u_scale.origin[1]\n\n\n\t\tv_buffer.u_move.stage[0] += 0.25 * (v_buffer.u_move.state[0] - v_buffer.u_move.stage[0])\n\t\tv_buffer.u_move.stage[1] += 0.25 * (v_buffer.u_move.state[1] - v_buffer.u_move.stage[1])\n\n\t\tv_buffer.u_scale.stage[0] += 0.25 * (v_buffer.u_scale.state[0] - v_buffer.u_scale.stage[0])\n\t\tv_buffer.u_scale.stage[1] += 0.25 * (v_buffer.u_scale.state[1] - v_buffer.u_scale.stage[1])\n\n\n\n\t\t@gl.uniform2f(shader.u_move, v_buffer.u_move.stage[0], v_buffer.u_move.stage[1])\n\t\t@gl.uniform2f(shader.u_scale, v_buffer.u_scale.stage[0], v_buffer.u_scale.stage[1])\n\t\tfor u in shader._uniforms\n\t\t\tif u.isArray\n\t\t\t\tu.set(u.loc,shader.uniforms[u.name].value)\n\t\t\telse\n\t\t\t\t_u = shader.uniforms[u.name]\n\t\t\t\t# if _u.value == undefined\n\t\t\t\t# \tconsole.error(u.name,_u)\n\t\t\t\t# \tthrow new TypeError 'incorrect uniform value - undefined'\n\t\t\t\tif Array.isArray(_u.value)\n\t\t\t\t\tu.set(u.loc,_u.value[0],_u.value[1],_u.value[2],_u.value[3])\n\t\t\t\telse\n\t\t\t\t\tu.set(u.loc,_u.value)\n\n\t\n\t\t@gl.bindBuffer(@gl.ARRAY_BUFFER, v_buffer)\n\t\t@gl.vertexAttribPointer(shader.a_position, 2, @gl.FLOAT, false, 0, 0)\n\t\t@gl.enableVertexAttribArray(shader.a_position)\n\t\t\n\n\t\t@gl.bindBuffer(@gl.ARRAY_BUFFER, shader.uv_buffer)\n\t\t@gl.vertexAttribPointer(shader.a_texture, 2, @gl.FLOAT, false, 0, 0)\n\t\t@gl.enableVertexAttribArray(shader.a_texture)\n\t\t\n\t\tif shader.texture\n\t\t\t@gl.bindTexture(@gl.TEXTURE_2D, shader.texture);\n\t\t\t@gl.uniform1i(shader.u_texture, 0);\n\t\t\n\t\t\n\t\t@gl.drawArrays(@gl.TRIANGLE_STRIP, 0,4)\n\t\treturn @\n\n\nclass Shader\n\tconstructor: (opt)->\n\t\t@code = opt.source\n\t\t@textureUrl = opt.textureUrl\n\t\t\n\n\n\t\t@uniforms = opt.uniforms\n\t\t@_uniforms = []\n\t\t@focus = false\n\t\t@uv = opt.uv || [1.0,1.0]\n\tupdateUvBuffer: ()->\n\t\tif @box.focus == @index && !@focus\n\t\t\t@focus = true\n\t\t\t@setUvBuffer(@index)\n\t\telse if @box.focus != @index && @focus\n\t\t\t@focus = false\n\t\t\t@setUvBuffer(@index)\n\t\t\t\n\t\n\tsetUvBuffer: (i)->\n\t\t# console.log @image_ratio_y,@image_ratio_x\n\t\tif @focus\n\t\t\tnw = @box.width / @uv[0]\n\t\t\tnh = @box.height / @uv[1]\n\t\telse\n\t\t\tnw = @box.width / @uv[0] / @box.grid[0]\n\t\t\tnh = @box.height / @uv[1] / @box.grid[1]\n\t\n\t\tr_x = ( (.5) - ((nw / nh) / 2))\n\t\tr_y = ( (.5) - (nh / nw) / 2 )\n\n\t\t# if r_x > 0\n\t\tr_y = 0\n\t\t# \t# r_x *= @image_ratio_x\n\t\t# else\n\t\t# \tr_x = 0\n\t\t\t# r_y *= @image_ratio_y\n\t\t@uv_buffer = @box.createBuffer(@box.pos[i].x,@box.pos[i].y,[ r_x,1-r_y, r_x,r_y, 1-r_x,1-r_y ,1-r_x,0+r_y, ])\n\n\n\tsetVertBuffer: (i)->\n\t\t@vert_buffer = @box.createBuffer(@box.pos[i].x,@box.pos[i].y,[-1,-1,-1,1,1,-1,1,1])\n\t\t\t\t\n\n\tinit: (@box,@index)->\n\n\n\t\t@setUvBuffer(@index)\n\t\t@setVertBuffer(@index)\n\n\t\t\n\n\t\t@gl = @box.gl\n\t\t@program = @createProgram(default_vertex_shader,@code)\n\n\n\t\t@a_position = @gl.getAttribLocation(@program, \"a_position\")\n\t\t@a_texture = @gl.getAttribLocation(@program, \"a_texture\")\n\t\t@u_move = @gl.getUniformLocation(@program, \"u_move\")\n\t\t@u_scale = @gl.getUniformLocation(@program, \"u_scale\")\n\t\t@u_texture = @gl.getUniformLocation(@program, \"u_texture\")\n\n\t\n\t\tif @textureUrl\n\t\t\t@texture = @gl.createTexture()\n\t\t\t@gl.bindTexture(@gl.TEXTURE_2D, @texture)\n\t\t\t@gl.texImage2D(@gl.TEXTURE_2D, 0, @gl.RGBA, 1, 1, 0, @gl.RGBA, @gl.UNSIGNED_BYTE,new Uint8Array([0, 0, 255, 255]))\n\t\t\timage = new Image()\n\t\t\timage.crossOrigin = \"\"\n\t\t\timage.src = @textureUrl\n\t\t\timage.addEventListener 'load', (e)=>\n\t\t\t\t@gl.bindTexture(@gl.TEXTURE_2D, @texture)\n\t\t\t\t@gl.texImage2D(@gl.TEXTURE_2D, 0, @gl.RGBA,@gl.RGBA,@gl.UNSIGNED_BYTE, image)\n\t\t\t\t@gl.texParameteri(@gl.TEXTURE_2D, @gl.TEXTURE_WRAP_S, @gl.CLAMP_TO_EDGE)\n\t\t\t\t@gl.texParameteri(@gl.TEXTURE_2D, @gl.TEXTURE_WRAP_T, @gl.CLAMP_TO_EDGE)\n\t\t\t\t@gl.texParameteri(@gl.TEXTURE_2D, @gl.TEXTURE_MIN_FILTER, @gl.LINEAR)\n\t\t\t\t@gl.texParameteri(@gl.TEXTURE_2D, @gl.TEXTURE_MAG_FILTER, @gl.LINEAR)\n\t\t\t\t@setUvBuffer(@index)\n\n\n\t\tfor key,val of @uniforms\n\t\t\tu = \n\t\t\t\tloc: @gl.getUniformLocation(@program,key)\n\t\t\t\tset: @gl[\"uniform\"+val.type].bind(@gl)\n\t\t\t\tname: key\n\t\t\t\tisArray: val.type.match(/v$/)?\n\t\t\t@_uniforms.push u\n\t\n\t\n\n\tcreateProgram: (vert,frag)->\n\t\t# make fragment shader\n\t\tfs = @gl.createShader(@gl.FRAGMENT_SHADER)\n\t\t@gl.shaderSource(fs,frag)\n\t\t@gl.compileShader(fs)\n\t\tif !@gl.getShaderParameter(fs, @gl.COMPILE_STATUS)\n\t\t\tthrow new Error('\\nFRAGMENT_COMPILE_ERROR:\\n\\n'+@gl.getShaderInfoLog(fs)+'\\nSOURCE:\\n\\n'+@gl.getShaderSource(fs))\n\n\t\t# make vertex shader\n\t\tvs = @gl.createShader(@gl.VERTEX_SHADER)\n\t\t@gl.shaderSource(vs,vert)\n\t\t@gl.compileShader(vs)\n\t\tif !@gl.getShaderParameter(vs, @gl.COMPILE_STATUS)\n\t\t\tthrow new Error('\\nVERTEX_COMPILE_ERROR:\\n\\n'+@gl.getShaderInfoLog(vs)+'\\nSOURCE:\\n\\n'+gl.getShaderSource(vs))\n\n\t\t# make and use program\n\t\tprog = @gl.createProgram()\n\t\t@gl.attachShader(prog, fs)\n\t\t@gl.attachShader(prog, vs)\n\t\t@gl.linkProgram(prog)\n\n\t\tif !@gl.getProgramParameter(prog, @gl.LINK_STATUS)\n\t\t\tthrow new Error('SHADER_LINK_'+this.gl.getProgramInfoLog(prog))\n\t\t\n\t\treturn prog\n\nmodule.exports = {Box,Shader}","module.exports=opts=>\"attribute vec2 a_position;\\nattribute vec2 a_texture;\\nuniform vec2 u_move;\\nuniform vec2 u_scale;\\nvarying vec2 v_uv;\\nvoid main() {\\n\\tgl_Position = vec4((a_position + u_move) * u_scale, 0.0, 1.0);\\n\\tv_uv = a_texture;\\n}\\n\";","module.exports=opts=>\"precision highp float;\\nuniform vec2 pos;\\nuniform float iTime;\\nvarying vec2 v_uv;\\nfloat random(in vec2 _st) {\\n\\treturn fract(sin(dot(_st.xy, vec2(12.9898, 78.233))) * 43758.54531237);\\n}\\nfloat noise(in vec2 _st) {\\n\\tvec2 i = floor(_st);\\n\\tvec2 f = fract(_st);\\n\\tfloat a = random(i);\\n\\tfloat b = random(i + vec2(1.0, 0.0));\\n\\tfloat c = random(i + vec2(0.0, 1.0));\\n\\tfloat d = random(i + vec2(1.0, 1.0));\\n\\tvec2 u = (f * f) * (3. - (2.0 * f));\\n\\treturn (mix(a, b, u.x) + (((c - a) * u.y) * (1. - u.x))) + (((d - b) * u.x) * u.y);\\n}\\nfloat light(in vec2 pos, in float size, in float radius, in float inner_fade, in float outer_fade) {\\n\\tfloat len = length(pos / size);\\n\\treturn pow(clamp(1.0 - pow(clamp(len - radius, 0.0, 1.0), 1.0 / inner_fade), 0.0, 1.0), 1.0 / outer_fade);\\n}\\nfloat flare(in float angle, in float alpha, in float time) {\\n\\tfloat t = time;\\n\\tfloat n = noise(vec2(((t + 0.5) + abs(angle)) + pow(alpha, 0.6), (t - abs(angle)) + pow(alpha + 0.1, 0.6)) * 7.0);\\n\\tfloat split = 15.0 + (sin((((t * 2.0) + (n * 4.0)) + (angle * 20.0)) + ((alpha * 1.0) * n)) * ((.3 + .5) + ((alpha * .6) * n)));\\n\\tfloat rotate = sin((angle * 20.0) + sin(((((angle * 15.0) + (alpha * 4.0)) + (t * 30.0)) + (n * 5.0)) + (alpha * 4.0))) * (.5 + (alpha * 1.5));\\n\\tfloat g = pow(((2.0 + (sin((split + ((n * 1.5) * alpha)) + rotate) * 1.4)) * n) * 4.0, n * (1.5 - (0.8 * alpha)));\\n\\tg *= (((alpha * alpha) * alpha) * .4);\\n\\tg += ((alpha * .7) + ((g * g) * g));\\n\\treturn g;\\n}\\n#define SIZE 2.3\\n#define RADIUS 0.099\\n#define INNER_FADE .8\\n#define OUTER_FADE 0.02\\n#define OUTER_FADE_2 0.01\\n#define SPEED .1\\n#define BORDER 0.21999\\nvoid main() {\\n\\tvec2 uv = vec2(v_uv - 0.5) * 1.5;\\n\\tfloat f = .0;\\n\\tfloat f2 = .0;\\n\\tfloat t = iTime * SPEED;\\n\\tfloat alpha = light(uv, SIZE, RADIUS, INNER_FADE, OUTER_FADE);\\n\\tfloat angle = atan(uv.x, uv.y);\\n\\tfloat n = noise(vec2((uv.x * 20.) + iTime, (uv.y * 20.) + iTime));\\n\\tfloat l = length(uv);\\n\\tif (l < BORDER) {\\n\\t\\tt *= .8;\\n\\t\\talpha = 1. - (pow((BORDER - l) / BORDER, 0.22) * 0.7);\\n\\t\\talpha = clamp(alpha - (light(uv, 0.2, 0.0, 1.3, .7) * .55), .0, 1.);\\n\\t\\tf = flare(angle * 1.0, alpha, (-t * .5) + alpha);\\n\\t\\tf2 = flare(angle * 1.0, alpha, (-t + (alpha * .5)) + 0.38134);\\n\\t}\\n\\telse if (alpha < 0.001) {\\n\\t\\tf = alpha;\\n\\t}\\n\\telse {\\n\\t\\tf = flare(angle, alpha, t) * 1.3;\\n\\t}\\n\\tgl_FragColor = vec4(vec3((f * (1.0 + (sin(angle - (t * 4.)) * .3))) + ((f2 * f2) * f2), (f * alpha) + ((f2 * f2) * 2.0), ((f * alpha) * 0.5) + (f2 * (1.0 + (sin(angle + (t * 4.)) * .3)))), 1.0);\\n}\\n\";","module.exports=opts=>\"precision highp float;\\nvarying vec2 v_uv;\\nuniform float iTime;\\nconst vec3 inkColor = vec3(0.01, 0.01, 0.1);\\nconst vec3 paperColor = vec3(1.0, 0.98, 0.94);\\nconst float speed = 0.01;\\nconst float shadeContrast = 0.55;\\nconst float F3 = 0.3333333;\\nconst float G3 = 0.1666667;\\nvec3 random3(vec3 c) {\\n\\tfloat j = 4096.0 * sin(dot(c, vec3(17.0, 59.4, 15.0)));\\n\\tvec3 r;\\n\\tr.z = fract(512.0 * j);\\n\\tj *= .125;\\n\\tr.x = fract(512.0 * j);\\n\\tj *= .125;\\n\\tr.y = fract(512.0 * j);\\n\\treturn r - 0.5;\\n}\\nfloat simplex3d(vec3 p) {\\n\\tvec3 s = floor(p + dot(p, vec3(F3)));\\n\\tvec3 x = (p - s) + dot(s, vec3(G3));\\n\\tvec3 e = step(vec3(0.0), x - x.yzx);\\n\\tvec3 i1 = e * (1.0 - e.zxy);\\n\\tvec3 i2 = 1.0 - (e.zxy * (1.0 - e));\\n\\tvec3 x1 = (x - i1) + G3;\\n\\tvec3 x2 = (x - i2) + (2.0 * G3);\\n\\tvec3 x3 = (x - 1.0) + (3.0 * G3);\\n\\tvec4 w, d;\\n\\tw.x = dot(x, x);\\n\\tw.y = dot(x1, x1);\\n\\tw.z = dot(x2, x2);\\n\\tw.w = dot(x3, x3);\\n\\tw = max(0.6 - w, 0.0);\\n\\td.x = dot(random3(s), x);\\n\\td.y = dot(random3(s + i1), x1);\\n\\td.z = dot(random3(s + i2), x2);\\n\\td.w = dot(random3(s + 1.0), x3);\\n\\tw *= w;\\n\\tw *= w;\\n\\td *= w;\\n\\treturn dot(d, vec4(52.0));\\n}\\nfloat fbm(vec3 p) {\\n\\tfloat f = 0.0;\\n\\tfloat frequency = 1.0;\\n\\tfloat amplitude = 0.5;\\n\\tfor (int i = 0; i < 5; i++) {\\n\\t\\tf += (simplex3d(p * frequency) * amplitude);\\n\\t\\tamplitude *= 0.5;\\n\\t\\tfrequency *= (2.0 + (float(i) / 100.0));\\n\\t}\\n\\treturn min(f, 1.0);\\n}\\n#define SCALE 3.0\\nvoid main() {\\n\\tvec2 uv = vec2(v_uv);\\n\\tuv.x = 1.0 - (abs(.5 - uv.x) * SCALE);\\n\\tuv.y *= SCALE;\\n\\tvec3 p = vec3(uv, iTime * speed);\\n\\tfloat blot = fbm((p * 3.0) + 8.0);\\n\\tfloat shade = fbm((p * 2.0) + 16.0);\\n\\tblot = blot + (sqrt(uv.x) - abs((SCALE / 2.0) - uv.y));\\n\\tblot = smoothstep(0.65, 0.71, blot) * max(1.0 - (shade * shadeContrast), 0.0);\\n\\tgl_FragColor = vec4(mix(paperColor, inkColor, blot), 1.0);\\n}\\n\";","module.exports=opts=>\"precision highp float;\\nuniform float iTime;\\nuniform vec2 pos;\\nvarying vec2 v_uv;\\nuniform sampler2D u_texture;\\nvoid main() {\\n\\tvec4 sum = vec4(0.0);\\n\\tvec2 uv = v_uv;\\n\\tgl_FragColor = texture2D(u_texture, vec2(uv.x, uv.y) * pos);\\n}\\n\";"],"sourceRoot":""}