{ "author": "FlokiTV", "description": "", "extensionNamespace": "", "fullName": "Sprite Stack", "helpPath": "https://github.com/FlokiTV/GDevelop-Voxel-Sprite-Stack", "iconUrl": "data:image/png;base64,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", "name": "SpriteStack", "previewIconUrl": "https://raw.githubusercontent.com/FlokiTV/GDevelop-Voxel-Sprite-Stack/main/icon.png", "shortDescription": "", "version": "beta 0.3", "tags": [], "dependencies": [], "eventsFunctions": [ { "description": "", "fullName": "Sprite Stack From URL", "functionType": "Action", "name": "SpritStackFromURL", "private": true, "sentence": "Load from _PARAM1_ on _PARAM2_, _PARAM3_ x _PARAM4_, Scale: _PARAM5_, _PARAM6_, Rotate: _PARAM7_, Angle: _PARAM8_", "events": [ { "disabled": false, "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { "inverted": false, "value": "BuiltinCommonInstructions::Once" }, "parameters": [], "subInstructions": [] } ], "actions": [], "events": [ { "disabled": false, "folded": false, "type": "BuiltinCommonInstructions::JsCode", "inlineCode": "let _o = objects[0]\nlet URL = eventsFunctionContext.getArgument(\"URL\")\nlet NAME = URL.split('/')\nNAME = NAME[NAME.length -1]\n\nconst loader = new PIXI.Loader();\nloader.add(NAME, URL)\n\nlet container = new PIXI.Container();\n\nlet __o = _o.getRendererObject()\n__o.addChild(container)\nlet w = eventsFunctionContext.getArgument(\"W\")\nlet h = eventsFunctionContext.getArgument(\"H\")\nlet scale = eventsFunctionContext.getArgument(\"Scale\")\nlet slice = scale * 1 //set 0 to no fill\nif(!eventsFunctionContext.getArgument(\"Density\")) slice = 0\n\n__o.scale.y = __o.scale.y / 2;\ncontainer.angle = 45\ncontainer.filters = [\n new PIXI.filters.OutlineFilter(1),\n // new PIXI.filters.DropShadowFilter({\n // distance: 10,\n // rotation: -190,\n // pixelSize: 0,\n // })\n]\n\nloader.load((loader, resources) => {\n let _t = resources[NAME].texture\n let _h = _t.height\n let size = _t.height / h\n for (var i = 1; i <= size; i++) {\n let rect = new PIXI.Rectangle(0, _h - h * i, w, h-0.05)\n let txt = new PIXI.Texture(_t, rect)\n let sprite = new PIXI.Sprite(txt)\n sprite.anchor.set(0.5, 0.5)\n sprite.scale.x = scale\n sprite.scale.y = scale\n container.addChild(sprite)\n }\n \n let c_size = container.children.length\n for (var e = 0; e < c_size; e++) {\n let o = container.children[e]\n let size = (e * scale) * -1 //calculate extrude space\n o.position.set(size, size)\n //fill space density\n for (var t = 0; t < slice; t++) {\n let _x = new PIXI.Sprite(o.texture)\n _x.anchor.set(0.5, 0.5);\n _x.scale.x = scale\n _x.scale.y = scale\n _x.position.set(\n o.position.x - t,\n o.position.y - t\n )\n container.addChild(_x)\n }\n }\n // container.children.forEach(obj =>{\n // obj.zIndex = obj.y\n // })\n container.children.forEach(obj =>{\n let ang = eventsFunctionContext.getArgument(\"Angle\") - 45\n obj.angle = ang\n })\n \n if(eventsFunctionContext.getArgument(\"Rotate\"))\n setInterval(()=>{\n container.children.forEach(obj =>{\n let ang = obj.angle\n obj.angle = ang + 1\n })\n },50)\n \n})", "parameterObjects": "Render", "useStrict": true, "eventsSheetExpanded": true } ] } ], "parameters": [ { "codeOnly": false, "defaultValue": "", "description": "Image URL", "longDescription": "", "name": "URL", "optional": false, "supplementaryInformation": "", "type": "string" }, { "codeOnly": false, "defaultValue": "", "description": "", "longDescription": "", "name": "Render", "optional": false, "supplementaryInformation": "Sprite", "type": "objectList" }, { "codeOnly": false, "defaultValue": "", "description": "W", "longDescription": "", "name": "W", "optional": false, "supplementaryInformation": "", "type": "expression" }, { "codeOnly": false, "defaultValue": "", "description": "H", "longDescription": "", "name": "H", "optional": false, "supplementaryInformation": "", "type": "expression" }, { "codeOnly": false, "defaultValue": "", "description": "Scale", "longDescription": "", "name": "Scale", "optional": false, "supplementaryInformation": "", "type": "expression" }, { "codeOnly": false, "defaultValue": "", "description": "Density", "longDescription": "", "name": "Density", "optional": false, "supplementaryInformation": "", "type": "trueorfalse" }, { "codeOnly": false, "defaultValue": "", "description": "Auto rotate", "longDescription": "", "name": "Rotate", "optional": false, "supplementaryInformation": "", "type": "trueorfalse" }, { "codeOnly": false, "defaultValue": "", "description": "Angle", "longDescription": "", "name": "Angle", "optional": false, "supplementaryInformation": "", "type": "expression" } ], "objectGroups": [] }, { "description": "Set Rotation - only works on objects loaded from URL", "fullName": "Set Rotation", "functionType": "Action", "name": "SetRotation", "private": true, "sentence": "Set object _PARAM1_ rotation _PARAM2_", "events": [ { "disabled": false, "folded": false, "type": "BuiltinCommonInstructions::JsCode", "inlineCode": "let _o = objects[0]\nlet __o = _o.getRendererObject()\nlet container = __o.children[0]\n// container = container[0]\nlet ang = eventsFunctionContext.getArgument(\"Angle\")\nlet _ang = _o.getVariables().get(\"angle\").getValue() || 0\nif(_ang){\n ang = parseInt(ang) + parseInt(_ang)\n _o.getVariables().get(\"angle\").setValue(ang)\n}\ncontainer.children.forEach(obj =>{ obj.angle = ang - 45 })\n", "parameterObjects": "Object", "useStrict": true, "eventsSheetExpanded": true } ], "parameters": [ { "codeOnly": false, "defaultValue": "", "description": "Object", "longDescription": "", "name": "Object", "optional": false, "supplementaryInformation": "", "type": "objectList" }, { "codeOnly": false, "defaultValue": "", "description": "Angle", "longDescription": "", "name": "Angle", "optional": false, "supplementaryInformation": "", "type": "expression" } ], "objectGroups": [] }, { "description": "InitEngine", "fullName": "Initialize the Stack Engine", "functionType": "Action", "name": "InitEngine", "private": false, "sentence": "Add FPS Counter _PARAM1_", "events": [ { "disabled": false, "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { "inverted": false, "value": "DepartScene" }, "parameters": [ "" ], "subInstructions": [] }, { "type": { "inverted": false, "value": "BuiltinCommonInstructions::Once" }, "parameters": [], "subInstructions": [] } ], "actions": [], "events": [ { "disabled": false, "folded": false, "type": "BuiltinCommonInstructions::JsCode", "inlineCode": "window.runtimeScene = runtimeScene\n/* Stats.js */\nvar Stats=function(){var e=0,t=document.createElement(\"div\");function l(e){return t.appendChild(e.dom),e}function n(l){for(var n=0;n=i+1e3&&(r.update(1e3*o/(e-i),100),i=e,o=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:t,setMode:n}};Stats.Panel=function(e,t,l){var n=1/0,a=0,i=Math.round,o=i(window.devicePixelRatio||1),r=80*o,f=48*o,c=3*o,d=2*o,p=3*o,s=15*o,u=74*o,m=30*o,h=document.createElement(\"canvas\");h.width=r,h.height=f,h.style.cssText=\"width:80px;height:48px\";var S=h.getContext(\"2d\");return S.font=\"bold \"+9*o+\"px Helvetica,Arial,sans-serif\",S.textBaseline=\"top\",S.fillStyle=l,S.fillRect(0,0,r,f),S.fillStyle=t,S.fillText(e,c,d),S.fillRect(p,s,u,m),S.fillStyle=l,S.globalAlpha=.9,S.fillRect(p,s,u,m),{dom:h,update:function(f,v){n=Math.min(n,f),a=Math.max(a,f),S.fillStyle=l,S.globalAlpha=1,S.fillRect(0,0,r,s),S.fillStyle=t,S.fillText(i(f)+\" \"+e+\" (\"+i(n)+\"-\"+i(a)+\")\",c,d),S.drawImage(h,p+o,s,u-o,m,p,s,u-o,m),S.fillRect(p+u-o,s,o,m),S.fillStyle=l,S.globalAlpha=.9,S.fillRect(p+u-o,s,o,i((1-f/v)*m))}}};\n\nif(eventsFunctionContext.getArgument(\"FPS\")){\n var stats = new Stats()\n document.body.appendChild(stats.dom)\n requestAnimationFrame(function loop(){\n stats.update();\n requestAnimationFrame(loop)\n });\n}\n\n", "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": true } ] }, { "disabled": false, "folded": false, "type": "BuiltinCommonInstructions::JsCode", "inlineCode": "const MAIN = runtimeScene.getLayer().getRenderer().getRendererObject().parent\nconst ISOMETRIC = runtimeScene.getVariables().get(\"CAMERA_STACK\").getValue() == 1 ? true : false\nvar layer = runtimeScene.getLayer()\nif(ISOMETRIC){\n// ._cachedGameResolutionHeight\n// layer._cachedGameResolutionWidth\n // MAIN.scale.x = 2\n // layer._cachedGameResolutionWidth = 1600\n // layer._cachedGameResolutionHeight = 1200\n // layer._renderer._pixiContainer.scale.y = 0.5\n // MAIN.height/\n // MAIN.width/\n // MAIN.pivot.x = parseInt(1200/4)*-1\n //* - 1\n MAIN.scale.y = 0.5\n MAIN.pivot.y = parseInt(layer._cachedGameResolutionHeight/2)*-1\n}\n", "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": true }, { "disabled": false, "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [], "events": [] } ], "parameters": [ { "codeOnly": false, "defaultValue": "", "description": "Add FPS counter", "longDescription": "", "name": "FPS", "optional": false, "supplementaryInformation": "", "type": "trueorfalse" } ], "objectGroups": [] }, { "description": "", "fullName": "Handle Rotate Camera", "functionType": "Action", "name": "HandleCameraRotation", "private": false, "sentence": "Camera rotation sensitivity _PARAM1_", "events": [ { "colorB": 228, "colorG": 176, "colorR": 74, "creationTime": 0, "disabled": false, "folded": false, "name": "Camera Rotation", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ { "disabled": false, "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { "inverted": false, "value": "BuiltinCommonInstructions::Once" }, "parameters": [], "subInstructions": [] } ], "actions": [], "events": [ { "disabled": false, "folded": false, "type": "BuiltinCommonInstructions::JsCode", "inlineCode": "window.dragging = false\nvar layer = runtimeScene.getLayer()\nvar canvas = runtimeScene.getRenderer().getPIXIRenderer().view\n\ndocument.addEventListener(\"mousemove\", e => {\n if(dragging){\n let sens = parseFloat(eventsFunctionContext.getArgument(\"Sensitivity\")) /10\n let r = layer.getCameraRotation()\n layer.setCameraRotation(r + sens * e.movementX)\n runtimeScene.getLayer(\"shadow\").setCameraRotation(r + sens * e.movementX)\n div.innerText = \"X position: \" + e.movementX + \", Y position: \" + e.movementY \n }\n}, false)\n\nlet div = document.createElement('div')\ndiv.style.position = \"fixed\"\ndiv.style.zIndex = \"999\"\ndiv.innerText = \" \"\ndiv.style.top = 10 +\"px\"\ndiv.style.left = 200 +\"px\"\n// document.querySelector('body').appendChild(div)\n\nconst normalize = (val, max, min) => (val - min) / (max - min)\n// setInterval(()=>{\n// let r = layer.getCameraRotation()\n// r = r % 360\n// if (r < 0)\n// r += 360\n// // if(r > 90 && r < 270) _o.setZOrder(_o.getY())\n// // console.log(r)\n// if(r < 90 || r > 270) console.log(\"1\")\n// else console.log(\"-1\")\n// console.log(normalize(r,360,0))\n// let _a = Math.pow(layer.getCameraX() - 0, 2)\n// let _b = Math.pow((layer.getCameraY() + runtimeScene.getLayer().getCameraHeight()) - 0, 2)\n// let _d = Math.sqrt(_a+_b) // distance of camera\n// console.log(_d)\n// },1000)", "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": true } ] }, { "disabled": false, "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { "inverted": false, "value": "MouseButtonPressed" }, "parameters": [ "", "Right" ], "subInstructions": [] } ], "actions": [], "events": [ { "disabled": false, "folded": false, "type": "BuiltinCommonInstructions::JsCode", "inlineCode": "var canvas = runtimeScene.getRenderer().getPIXIRenderer().view\ncanvas.requestPointerLock()\nwindow.dragging = true", "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": false } ] }, { "disabled": false, "folded": true, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { "inverted": true, "value": "MouseButtonPressed" }, "parameters": [ "", "Right" ], "subInstructions": [] } ], "actions": [], "events": [ { "disabled": false, "folded": false, "type": "BuiltinCommonInstructions::JsCode", "inlineCode": "document.exitPointerLock()\nwindow.dragging = false", "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": false } ] } ], "parameters": [] } ], "parameters": [ { "codeOnly": false, "defaultValue": "", "description": "Sensitivity multiplayer 1~10", "longDescription": "", "name": "Sensitivity", "optional": false, "supplementaryInformation": "", "type": "expression" } ], "objectGroups": [] }, { "description": "Normalize Layer to non 3D scale", "fullName": "Normalize Layer to non 3D scale", "functionType": "Action", "name": "NormalizeLayer", "private": false, "sentence": "Normalize _PARAM1_ to non 3D scale", "events": [ { "disabled": false, "folded": false, "type": "BuiltinCommonInstructions::JsCode", "inlineCode": "const normalize = (val, max, min) => (val - min) / (max - min)\nlet ISOMETRIC = runtimeScene.getVariables().get(\"CAMERA_STACK\").getValue() == 1 ? true : false\nlet layer = runtimeScene.getLayer(eventsFunctionContext.getArgument(\"Layer\"))\nlet pixiContainer = layer._renderer._pixiContainer\nconst angle = -gdjs.toRad(layer.getCameraRotation())\n\nif(ISOMETRIC){\n pixiContainer.scale.y = 2\n pixiContainer.pivot.y = layer.getCameraHeight() / 4\n}\n\nif(false){\n let rot = runtimeScene.getLayer().getCameraRotation()%360\n if(rot < 0) rot = rot+360\n // let an = gdjs.toRad(rot)\n // an = normalize(an, Math.PI, 0)\n rot = parseFloat(normalize(rot, 360, 0))\n\n let zoom = layer.getCameraZoom()\n let zoomFactor = zoom //- (zoom * rot) \n let zoomFactory = zoom //- (zoom * rot / 2) \n\n pixiContainer.scale.x = zoomFactor //+ (zoomFactor * an);\n pixiContainer.scale.y = zoomFactory //+ (zoomFactory * an);\n const cosValue = Math.cos(angle);\n const sinValue = Math.sin(angle);\n const centerX =\n layer.getCameraX() * zoomFactor * cosValue -\n layer.getCameraY() * zoomFactory * sinValue;\n const centerY =\n layer.getCameraX() * zoomFactor * sinValue +\n layer.getCameraY() * zoomFactory * cosValue;\n\n pixiContainer.position.x = -centerX;\n pixiContainer.position.y = -centerY;\n pixiContainer.position.x +=layer.getWidth() / 2;\n pixiContainer.position.y +=layer.getHeight() / 2;\n}\n", "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": true } ], "parameters": [ { "codeOnly": false, "defaultValue": "", "description": "Layer", "longDescription": "", "name": "Layer", "optional": false, "supplementaryInformation": "", "type": "string" } ], "objectGroups": [] }, { "description": "", "fullName": "", "functionType": "Action", "name": "onFirstSceneLoaded", "private": false, "sentence": "", "events": [ { "disabled": false, "folded": false, "type": "BuiltinCommonInstructions::JsCode", "inlineCode": "\n/*!\n\tIM TRYING TI FIND THIS FILTERS INSIDE GDJS...\n\tFOR NOW, IM MANUALLY IMPORT\n\n\t\n * pixi-filters - v4.1.0\n * Compiled Fri, 02 Apr 2021 03:06:01 UTC\n *\n * pixi-filters is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nvar __filters=function(e,n,t,r,o,i,l,a){\"use strict\";var s=function(e,n){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])})(e,n)};function u(e,n){function t(){this.constructor=e}s(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}Object.create;Object.create;var f=\"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\",c=function(e){function n(n){var t=e.call(this,f,\"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform float gamma;\\nuniform float contrast;\\nuniform float saturation;\\nuniform float brightness;\\nuniform float red;\\nuniform float green;\\nuniform float blue;\\nuniform float alpha;\\n\\nvoid main(void)\\n{\\n vec4 c = texture2D(uSampler, vTextureCoord);\\n\\n if (c.a > 0.0) {\\n c.rgb /= c.a;\\n\\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\\n rgb.r *= red;\\n rgb.g *= green;\\n rgb.b *= blue;\\n c.rgb = rgb * brightness;\\n\\n c.rgb *= c.a;\\n }\\n\\n gl_FragColor = c * alpha;\\n}\\n\")||this;return t.gamma=1,t.saturation=1,t.contrast=1,t.brightness=1,t.red=1,t.green=1,t.blue=1,t.alpha=1,Object.assign(t,n),t}return u(n,e),n.prototype.apply=function(e,n,t,r){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,e.applyFilter(this,n,t,r)},n}(n.Filter),m=function(e){function n(n){void 0===n&&(n=.5);var t=e.call(this,f,\"\\nuniform sampler2D uSampler;\\nvarying vec2 vTextureCoord;\\n\\nuniform float threshold;\\n\\nvoid main() {\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n\\n // A simple & fast algorithm for getting brightness.\\n // It's inaccuracy , but good enought for this feature.\\n float _max = max(max(color.r, color.g), color.b);\\n float _min = min(min(color.r, color.g), color.b);\\n float brightness = (_max + _min) * 0.5;\\n\\n if(brightness > threshold) {\\n gl_FragColor = color;\\n } else {\\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\\n }\\n}\\n\")||this;return t.threshold=n,t}return u(n,e),Object.defineProperty(n.prototype,\"threshold\",{get:function(){return this.uniforms.threshold},set:function(e){this.uniforms.threshold=e},enumerable:!1,configurable:!0}),n}(n.Filter),p=function(e){function n(n,r,o){void 0===n&&(n=4),void 0===r&&(r=3),void 0===o&&(o=!1);var i=e.call(this,f,o?\"\\nvarying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform vec2 uOffset;\\nuniform vec4 filterClamp;\\n\\nvoid main(void)\\n{\\n vec4 color = vec4(0.0);\\n\\n // Sample top left pixel\\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\\n\\n // Sample top right pixel\\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\\n\\n // Sample bottom right pixel\\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\\n\\n // Sample bottom left pixel\\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\\n\\n // Average\\n color *= 0.25;\\n\\n gl_FragColor = color;\\n}\\n\":\"\\nvarying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform vec2 uOffset;\\n\\nvoid main(void)\\n{\\n vec4 color = vec4(0.0);\\n\\n // Sample top left pixel\\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y));\\n\\n // Sample top right pixel\\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y));\\n\\n // Sample bottom right pixel\\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y));\\n\\n // Sample bottom left pixel\\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y));\\n\\n // Average\\n color *= 0.25;\\n\\n gl_FragColor = color;\\n}\")||this;return i._kernels=[],i._blur=4,i._quality=3,i.uniforms.uOffset=new Float32Array(2),i._pixelSize=new t.Point,i.pixelSize=1,i._clamp=o,Array.isArray(n)?i.kernels=n:(i._blur=n,i.quality=r),i}return u(n,e),n.prototype.apply=function(e,n,t,r){var o,i=this._pixelSize.x/n._frame.width,l=this._pixelSize.y/n._frame.height;if(1===this._quality||0===this._blur)o=this._kernels[0]+.5,this.uniforms.uOffset[0]=o*i,this.uniforms.uOffset[1]=o*l,e.applyFilter(this,n,t,r);else{for(var a=e.getFilterTexture(),s=n,u=a,f=void 0,c=this._quality-1,m=0;m0)for(var r=e,o=e/n,i=1;i0?(this._kernels=e,this._quality=e.length,this._blur=Math.max.apply(Math,e)):(this._kernels=[0],this._quality=1)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"clamp\",{get:function(){return this._clamp},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"pixelSize\",{get:function(){return this._pixelSize},set:function(e){\"number\"==typeof e?(this._pixelSize.x=e,this._pixelSize.y=e):Array.isArray(e)?(this._pixelSize.x=e[0],this._pixelSize.y=e[1]):e instanceof t.Point?(this._pixelSize.x=e.x,this._pixelSize.y=e.y):(this._pixelSize.x=1,this._pixelSize.y=1)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"quality\",{get:function(){return this._quality},set:function(e){this._quality=Math.max(1,Math.round(e)),this._generateKernels()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"blur\",{get:function(){return this._blur},set:function(e){this._blur=e,this._generateKernels()},enumerable:!1,configurable:!0}),n}(n.Filter),d=function(e){function n(t){var o=e.call(this,f,\"uniform sampler2D uSampler;\\nvarying vec2 vTextureCoord;\\n\\nuniform sampler2D bloomTexture;\\nuniform float bloomScale;\\nuniform float brightness;\\n\\nvoid main() {\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n color.rgb *= brightness;\\n vec4 bloomColor = vec4(texture2D(bloomTexture, vTextureCoord).rgb, 0.0);\\n bloomColor.rgb *= bloomScale;\\n gl_FragColor = color + bloomColor;\\n}\\n\")||this;o.bloomScale=1,o.brightness=1,o._resolution=r.settings.FILTER_RESOLUTION,\"number\"==typeof t&&(t={threshold:t});var i=Object.assign(n.defaults,t);o.bloomScale=i.bloomScale,o.brightness=i.brightness;var l=i.kernels,a=i.blur,s=i.quality,u=i.pixelSize,c=i.resolution;return o._extractFilter=new m(i.threshold),o._extractFilter.resolution=c,o._blurFilter=l?new p(l):new p(a,s),o.pixelSize=u,o.resolution=c,o}return u(n,e),n.prototype.apply=function(e,n,t,r,o){var i=e.getFilterTexture();this._extractFilter.apply(e,n,i,1,o);var l=e.getFilterTexture();this._blurFilter.apply(e,i,l,1),this.uniforms.bloomScale=this.bloomScale,this.uniforms.brightness=this.brightness,this.uniforms.bloomTexture=l,e.applyFilter(this,n,t,r),e.returnFilterTexture(l),e.returnFilterTexture(i)},Object.defineProperty(n.prototype,\"resolution\",{get:function(){return this._resolution},set:function(e){this._resolution=e,this._extractFilter&&(this._extractFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"threshold\",{get:function(){return this._extractFilter.threshold},set:function(e){this._extractFilter.threshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"kernels\",{get:function(){return this._blurFilter.kernels},set:function(e){this._blurFilter.kernels=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"blur\",{get:function(){return this._blurFilter.blur},set:function(e){this._blurFilter.blur=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"quality\",{get:function(){return this._blurFilter.quality},set:function(e){this._blurFilter.quality=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"pixelSize\",{get:function(){return this._blurFilter.pixelSize},set:function(e){this._blurFilter.pixelSize=e},enumerable:!1,configurable:!0}),n.defaults={threshold:.5,bloomScale:1,brightness:1,kernels:null,blur:8,quality:4,pixelSize:1,resolution:r.settings.FILTER_RESOLUTION},n}(n.Filter),h=function(e){function n(n){void 0===n&&(n=8);var t=e.call(this,f,\"varying vec2 vTextureCoord;\\n\\nuniform vec4 filterArea;\\nuniform float pixelSize;\\nuniform sampler2D uSampler;\\n\\nvec2 mapCoord( vec2 coord )\\n{\\n coord *= filterArea.xy;\\n coord += filterArea.zw;\\n\\n return coord;\\n}\\n\\nvec2 unmapCoord( vec2 coord )\\n{\\n coord -= filterArea.zw;\\n coord /= filterArea.xy;\\n\\n return coord;\\n}\\n\\nvec2 pixelate(vec2 coord, vec2 size)\\n{\\n return floor( coord / size ) * size;\\n}\\n\\nvec2 getMod(vec2 coord, vec2 size)\\n{\\n return mod( coord , size) / size;\\n}\\n\\nfloat character(float n, vec2 p)\\n{\\n p = floor(p*vec2(4.0, -4.0) + 2.5);\\n\\n if (clamp(p.x, 0.0, 4.0) == p.x)\\n {\\n if (clamp(p.y, 0.0, 4.0) == p.y)\\n {\\n if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0;\\n }\\n }\\n return 0.0;\\n}\\n\\nvoid main()\\n{\\n vec2 coord = mapCoord(vTextureCoord);\\n\\n // get the rounded color..\\n vec2 pixCoord = pixelate(coord, vec2(pixelSize));\\n pixCoord = unmapCoord(pixCoord);\\n\\n vec4 color = texture2D(uSampler, pixCoord);\\n\\n // determine the character to use\\n float gray = (color.r + color.g + color.b) / 3.0;\\n\\n float n = 65536.0; // .\\n if (gray > 0.2) n = 65600.0; // :\\n if (gray > 0.3) n = 332772.0; // *\\n if (gray > 0.4) n = 15255086.0; // o\\n if (gray > 0.5) n = 23385164.0; // &\\n if (gray > 0.6) n = 15252014.0; // 8\\n if (gray > 0.7) n = 13199452.0; // @\\n if (gray > 0.8) n = 11512810.0; // #\\n\\n // get the mod..\\n vec2 modd = getMod(coord, vec2(pixelSize));\\n\\n gl_FragColor = color * character( n, vec2(-1.0) + modd * 2.0);\\n\\n}\\n\")||this;return t.size=n,t}return u(n,e),Object.defineProperty(n.prototype,\"size\",{get:function(){return this.uniforms.pixelSize},set:function(e){this.uniforms.pixelSize=e},enumerable:!1,configurable:!0}),n}(n.Filter),g=function(e){function n(n){var t=e.call(this,f,\"precision mediump float;\\n\\nvarying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\n\\nuniform float transformX;\\nuniform float transformY;\\nuniform vec3 lightColor;\\nuniform float lightAlpha;\\nuniform vec3 shadowColor;\\nuniform float shadowAlpha;\\n\\nvoid main(void) {\\n vec2 transform = vec2(1.0 / filterArea) * vec2(transformX, transformY);\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n float light = texture2D(uSampler, vTextureCoord - transform).a;\\n float shadow = texture2D(uSampler, vTextureCoord + transform).a;\\n\\n color.rgb = mix(color.rgb, lightColor, clamp((color.a - light) * lightAlpha, 0.0, 1.0));\\n color.rgb = mix(color.rgb, shadowColor, clamp((color.a - shadow) * shadowAlpha, 0.0, 1.0));\\n gl_FragColor = vec4(color.rgb * color.a, color.a);\\n}\\n\")||this;return t._thickness=2,t._angle=0,t.uniforms.lightColor=new Float32Array(3),t.uniforms.shadowColor=new Float32Array(3),Object.assign(t,{rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},n),t.padding=1,t}return u(n,e),n.prototype._updateTransform=function(){this.uniforms.transformX=this._thickness*Math.cos(this._angle),this.uniforms.transformY=this._thickness*Math.sin(this._angle)},Object.defineProperty(n.prototype,\"rotation\",{get:function(){return this._angle/t.DEG_TO_RAD},set:function(e){this._angle=e*t.DEG_TO_RAD,this._updateTransform()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"thickness\",{get:function(){return this._thickness},set:function(e){this._thickness=e,this._updateTransform()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"lightColor\",{get:function(){return o.rgb2hex(this.uniforms.lightColor)},set:function(e){o.hex2rgb(e,this.uniforms.lightColor)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"lightAlpha\",{get:function(){return this.uniforms.lightAlpha},set:function(e){this.uniforms.lightAlpha=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"shadowColor\",{get:function(){return o.rgb2hex(this.uniforms.shadowColor)},set:function(e){o.hex2rgb(e,this.uniforms.shadowColor)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"shadowAlpha\",{get:function(){return this.uniforms.shadowAlpha},set:function(e){this.uniforms.shadowAlpha=e},enumerable:!1,configurable:!0}),n}(n.Filter),v=function(e){function n(n,o,s,u){void 0===n&&(n=2),void 0===o&&(o=4),void 0===s&&(s=r.settings.FILTER_RESOLUTION),void 0===u&&(u=5);var f,c,m=e.call(this)||this;return\"number\"==typeof n?(f=n,c=n):n instanceof t.Point?(f=n.x,c=n.y):Array.isArray(n)&&(f=n[0],c=n[1]),m.blurXFilter=new a.BlurFilterPass(!0,f,o,s,u),m.blurYFilter=new a.BlurFilterPass(!1,c,o,s,u),m.blurYFilter.blendMode=i.BLEND_MODES.SCREEN,m.defaultFilter=new l.AlphaFilter,m}return u(n,e),n.prototype.apply=function(e,n,t,r){var o=e.getFilterTexture();this.defaultFilter.apply(e,n,t,r),this.blurXFilter.apply(e,n,o,1),this.blurYFilter.apply(e,o,t,0),e.returnFilterTexture(o)},Object.defineProperty(n.prototype,\"blur\",{get:function(){return this.blurXFilter.blur},set:function(e){this.blurXFilter.blur=this.blurYFilter.blur=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"blurX\",{get:function(){return this.blurXFilter.blur},set:function(e){this.blurXFilter.blur=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"blurY\",{get:function(){return this.blurYFilter.blur},set:function(e){this.blurYFilter.blur=e},enumerable:!1,configurable:!0}),n}(n.Filter),y=function(e){function n(t){var r=e.call(this,f,\"uniform float radius;\\nuniform float strength;\\nuniform vec2 center;\\nuniform sampler2D uSampler;\\nvarying vec2 vTextureCoord;\\n\\nuniform vec4 filterArea;\\nuniform vec4 filterClamp;\\nuniform vec2 dimensions;\\n\\nvoid main()\\n{\\n vec2 coord = vTextureCoord * filterArea.xy;\\n coord -= center * dimensions.xy;\\n float distance = length(coord);\\n if (distance < radius) {\\n float percent = distance / radius;\\n if (strength > 0.0) {\\n coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75);\\n } else {\\n coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent);\\n }\\n }\\n coord += center * dimensions.xy;\\n coord /= filterArea.xy;\\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\\n vec4 color = texture2D(uSampler, clampedCoord);\\n if (coord != clampedCoord) {\\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\\n }\\n\\n gl_FragColor = color;\\n}\\n\")||this;return r.uniforms.dimensions=new Float32Array(2),Object.assign(r,n.defaults,t),r}return u(n,e),n.prototype.apply=function(e,n,t,r){var o=n.filterFrame,i=o.width,l=o.height;this.uniforms.dimensions[0]=i,this.uniforms.dimensions[1]=l,e.applyFilter(this,n,t,r)},Object.defineProperty(n.prototype,\"radius\",{get:function(){return this.uniforms.radius},set:function(e){this.uniforms.radius=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"strength\",{get:function(){return this.uniforms.strength},set:function(e){this.uniforms.strength=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"center\",{get:function(){return this.uniforms.center},set:function(e){this.uniforms.center=e},enumerable:!1,configurable:!0}),n.defaults={center:[.5,.5],radius:100,strength:1},n}(n.Filter),b=function(e){function t(n,t,r){void 0===t&&(t=!1),void 0===r&&(r=1);var o=e.call(this,f,\"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform sampler2D colorMap;\\nuniform float _mix;\\nuniform float _size;\\nuniform float _sliceSize;\\nuniform float _slicePixelSize;\\nuniform float _sliceInnerSize;\\nvoid main() {\\n vec4 color = texture2D(uSampler, vTextureCoord.xy);\\n\\n vec4 adjusted;\\n if (color.a > 0.0) {\\n color.rgb /= color.a;\\n float innerWidth = _size - 1.0;\\n float zSlice0 = min(floor(color.b * innerWidth), innerWidth);\\n float zSlice1 = min(zSlice0 + 1.0, innerWidth);\\n float xOffset = _slicePixelSize * 0.5 + color.r * _sliceInnerSize;\\n float s0 = xOffset + (zSlice0 * _sliceSize);\\n float s1 = xOffset + (zSlice1 * _sliceSize);\\n float yOffset = _sliceSize * 0.5 + color.g * (1.0 - _sliceSize);\\n vec4 slice0Color = texture2D(colorMap, vec2(s0,yOffset));\\n vec4 slice1Color = texture2D(colorMap, vec2(s1,yOffset));\\n float zOffset = fract(color.b * innerWidth);\\n adjusted = mix(slice0Color, slice1Color, zOffset);\\n\\n color.rgb *= color.a;\\n }\\n gl_FragColor = vec4(mix(color, adjusted, _mix).rgb, color.a);\\n\\n}\")||this;return o.mix=1,o._size=0,o._sliceSize=0,o._slicePixelSize=0,o._sliceInnerSize=0,o._nearest=!1,o._scaleMode=null,o._colorMap=null,o._scaleMode=null,o.nearest=t,o.mix=r,o.colorMap=n,o}return u(t,e),t.prototype.apply=function(e,n,t,r){this.uniforms._mix=this.mix,e.applyFilter(this,n,t,r)},Object.defineProperty(t.prototype,\"colorSize\",{get:function(){return this._size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"colorMap\",{get:function(){return this._colorMap},set:function(e){var t;e&&(e instanceof n.Texture||(e=n.Texture.from(e)),(null===(t=e)||void 0===t?void 0:t.baseTexture)&&(e.baseTexture.scaleMode=this._scaleMode,e.baseTexture.mipmap=i.MIPMAP_MODES.OFF,this._size=e.height,this._sliceSize=1/this._size,this._slicePixelSize=this._sliceSize/this._size,this._sliceInnerSize=this._slicePixelSize*(this._size-1),this.uniforms._size=this._size,this.uniforms._sliceSize=this._sliceSize,this.uniforms._slicePixelSize=this._slicePixelSize,this.uniforms._sliceInnerSize=this._sliceInnerSize,this.uniforms.colorMap=e),this._colorMap=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"nearest\",{get:function(){return this._nearest},set:function(e){this._nearest=e,this._scaleMode=e?i.SCALE_MODES.NEAREST:i.SCALE_MODES.LINEAR;var n=this._colorMap;n&&n.baseTexture&&(n.baseTexture._glTextures={},n.baseTexture.scaleMode=this._scaleMode,n.baseTexture.mipmap=i.MIPMAP_MODES.OFF,n._updateID++,n.baseTexture.emit(\"update\",n.baseTexture))},enumerable:!1,configurable:!0}),t.prototype.updateColorMap=function(){var e=this._colorMap;e&&e.baseTexture&&(e._updateID++,e.baseTexture.emit(\"update\",e.baseTexture),this.colorMap=e)},t.prototype.destroy=function(n){void 0===n&&(n=!1),this._colorMap&&this._colorMap.destroy(n),e.prototype.destroy.call(this)},t}(n.Filter),x=function(e){function n(n,t){void 0===n&&(n=0),void 0===t&&(t=1);var r=e.call(this,f,\"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec3 color;\\nuniform float alpha;\\n\\nvoid main(void) {\\n vec4 currentColor = texture2D(uSampler, vTextureCoord);\\n gl_FragColor = vec4(mix(currentColor.rgb, color.rgb, currentColor.a * alpha), currentColor.a);\\n}\\n\")||this;return r._color=0,r._alpha=1,r.uniforms.color=new Float32Array(3),r.color=n,r.alpha=t,r}return u(n,e),Object.defineProperty(n.prototype,\"color\",{get:function(){return this._color},set:function(e){var n=this.uniforms.color;\"number\"==typeof e?(o.hex2rgb(e,n),this._color=e):(n[0]=e[0],n[1]=e[1],n[2]=e[2],this._color=o.rgb2hex(n))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"alpha\",{get:function(){return this._alpha},set:function(e){this.uniforms.alpha=e,this._alpha=e},enumerable:!1,configurable:!0}),n}(n.Filter),_=function(e){function n(n,t,r){void 0===n&&(n=16711680),void 0===t&&(t=0),void 0===r&&(r=.4);var o=e.call(this,f,\"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec3 originalColor;\\nuniform vec3 newColor;\\nuniform float epsilon;\\nvoid main(void) {\\n vec4 currentColor = texture2D(uSampler, vTextureCoord);\\n vec3 colorDiff = originalColor - (currentColor.rgb / max(currentColor.a, 0.0000000001));\\n float colorDistance = length(colorDiff);\\n float doReplace = step(colorDistance, epsilon);\\n gl_FragColor = vec4(mix(currentColor.rgb, (newColor + colorDiff) * currentColor.a, doReplace), currentColor.a);\\n}\\n\")||this;return o._originalColor=16711680,o._newColor=0,o.uniforms.originalColor=new Float32Array(3),o.uniforms.newColor=new Float32Array(3),o.originalColor=n,o.newColor=t,o.epsilon=r,o}return u(n,e),Object.defineProperty(n.prototype,\"originalColor\",{get:function(){return this._originalColor},set:function(e){var n=this.uniforms.originalColor;\"number\"==typeof e?(o.hex2rgb(e,n),this._originalColor=e):(n[0]=e[0],n[1]=e[1],n[2]=e[2],this._originalColor=o.rgb2hex(n))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"newColor\",{get:function(){return this._newColor},set:function(e){var n=this.uniforms.newColor;\"number\"==typeof e?(o.hex2rgb(e,n),this._newColor=e):(n[0]=e[0],n[1]=e[1],n[2]=e[2],this._newColor=o.rgb2hex(n))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"epsilon\",{get:function(){return this.uniforms.epsilon},set:function(e){this.uniforms.epsilon=e},enumerable:!1,configurable:!0}),n}(n.Filter),C=function(e){function n(n,t,r){void 0===t&&(t=200),void 0===r&&(r=200);var o=e.call(this,f,\"precision mediump float;\\n\\nvarying mediump vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform vec2 texelSize;\\nuniform float matrix[9];\\n\\nvoid main(void)\\n{\\n vec4 c11 = texture2D(uSampler, vTextureCoord - texelSize); // top left\\n vec4 c12 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - texelSize.y)); // top center\\n vec4 c13 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y - texelSize.y)); // top right\\n\\n vec4 c21 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y)); // mid left\\n vec4 c22 = texture2D(uSampler, vTextureCoord); // mid center\\n vec4 c23 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y)); // mid right\\n\\n vec4 c31 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y + texelSize.y)); // bottom left\\n vec4 c32 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + texelSize.y)); // bottom center\\n vec4 c33 = texture2D(uSampler, vTextureCoord + texelSize); // bottom right\\n\\n gl_FragColor =\\n c11 * matrix[0] + c12 * matrix[1] + c13 * matrix[2] +\\n c21 * matrix[3] + c22 * matrix[4] + c23 * matrix[5] +\\n c31 * matrix[6] + c32 * matrix[7] + c33 * matrix[8];\\n\\n gl_FragColor.a = c22.a;\\n}\\n\")||this;return o.uniforms.texelSize=new Float32Array(2),o.uniforms.matrix=new Float32Array(9),void 0!==n&&(o.matrix=n),o.width=t,o.height=r,o}return u(n,e),Object.defineProperty(n.prototype,\"matrix\",{get:function(){return this.uniforms.matrix},set:function(e){var n=this;e.forEach((function(e,t){n.uniforms.matrix[t]=e}))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"width\",{get:function(){return 1/this.uniforms.texelSize[0]},set:function(e){this.uniforms.texelSize[0]=1/e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"height\",{get:function(){return 1/this.uniforms.texelSize[1]},set:function(e){this.uniforms.texelSize[1]=1/e},enumerable:!1,configurable:!0}),n}(n.Filter),S=function(e){function n(){return e.call(this,f,\"precision mediump float;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\n\\nvoid main(void)\\n{\\n float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);\\n\\n gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\\n\\n if (lum < 1.00)\\n {\\n if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0)\\n {\\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\\n }\\n }\\n\\n if (lum < 0.75)\\n {\\n if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0)\\n {\\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\\n }\\n }\\n\\n if (lum < 0.50)\\n {\\n if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0)\\n {\\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\\n }\\n }\\n\\n if (lum < 0.3)\\n {\\n if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0)\\n {\\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\\n }\\n }\\n}\\n\")||this}return u(n,e),n}(n.Filter),F=function(e){function n(t){var r=e.call(this,f,\"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform vec4 filterArea;\\nuniform vec2 dimensions;\\n\\nconst float SQRT_2 = 1.414213;\\n\\nconst float light = 1.0;\\n\\nuniform float curvature;\\nuniform float lineWidth;\\nuniform float lineContrast;\\nuniform bool verticalLine;\\nuniform float noise;\\nuniform float noiseSize;\\n\\nuniform float vignetting;\\nuniform float vignettingAlpha;\\nuniform float vignettingBlur;\\n\\nuniform float seed;\\nuniform float time;\\n\\nfloat rand(vec2 co) {\\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\\n}\\n\\nvoid main(void)\\n{\\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\\n vec2 dir = vec2(vTextureCoord.xy - vec2(0.5, 0.5)) * filterArea.xy / dimensions;\\n\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n vec3 rgb = gl_FragColor.rgb;\\n\\n if (noise > 0.0 && noiseSize > 0.0)\\n {\\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\\n rgb += _noise * noise;\\n }\\n\\n if (lineWidth > 0.0)\\n {\\n float _c = curvature > 0. ? curvature : 1.;\\n float k = curvature > 0. ?(length(dir * dir) * 0.25 * _c * _c + 0.935 * _c) : 1.;\\n vec2 uv = dir * k;\\n\\n float v = (verticalLine ? uv.x * dimensions.x : uv.y * dimensions.y) * min(1.0, 2.0 / lineWidth ) / _c;\\n float j = 1. + cos(v * 1.2 - time) * 0.5 * lineContrast;\\n rgb *= j;\\n float segment = verticalLine ? mod((dir.x + .5) * dimensions.x, 4.) : mod((dir.y + .5) * dimensions.y, 4.);\\n rgb *= 0.99 + ceil(segment) * 0.015;\\n }\\n\\n if (vignetting > 0.0)\\n {\\n float outter = SQRT_2 - vignetting * SQRT_2;\\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\\n rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\\n }\\n\\n gl_FragColor.rgb = rgb;\\n}\\n\")||this;return r.time=0,r.seed=0,r.uniforms.dimensions=new Float32Array(2),Object.assign(r,n.defaults,t),r}return u(n,e),n.prototype.apply=function(e,n,t,r){var o=n.filterFrame,i=o.width,l=o.height;this.uniforms.dimensions[0]=i,this.uniforms.dimensions[1]=l,this.uniforms.seed=this.seed,this.uniforms.time=this.time,e.applyFilter(this,n,t,r)},Object.defineProperty(n.prototype,\"curvature\",{get:function(){return this.uniforms.curvature},set:function(e){this.uniforms.curvature=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"lineWidth\",{get:function(){return this.uniforms.lineWidth},set:function(e){this.uniforms.lineWidth=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"lineContrast\",{get:function(){return this.uniforms.lineContrast},set:function(e){this.uniforms.lineContrast=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"verticalLine\",{get:function(){return this.uniforms.verticalLine},set:function(e){this.uniforms.verticalLine=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"noise\",{get:function(){return this.uniforms.noise},set:function(e){this.uniforms.noise=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"noiseSize\",{get:function(){return this.uniforms.noiseSize},set:function(e){this.uniforms.noiseSize=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"vignetting\",{get:function(){return this.uniforms.vignetting},set:function(e){this.uniforms.vignetting=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"vignettingAlpha\",{get:function(){return this.uniforms.vignettingAlpha},set:function(e){this.uniforms.vignettingAlpha=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"vignettingBlur\",{get:function(){return this.uniforms.vignettingBlur},set:function(e){this.uniforms.vignettingBlur=e},enumerable:!1,configurable:!0}),n.defaults={curvature:1,lineWidth:1,lineContrast:.25,verticalLine:!1,noise:0,noiseSize:1,seed:0,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3,time:0},n}(n.Filter),z=function(e){function n(n,t){void 0===n&&(n=1),void 0===t&&(t=5);var r=e.call(this,f,\"precision mediump float;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec4 vColor;\\n\\nuniform vec4 filterArea;\\nuniform sampler2D uSampler;\\n\\nuniform float angle;\\nuniform float scale;\\n\\nfloat pattern()\\n{\\n float s = sin(angle), c = cos(angle);\\n vec2 tex = vTextureCoord * filterArea.xy;\\n vec2 point = vec2(\\n c * tex.x - s * tex.y,\\n s * tex.x + c * tex.y\\n ) * scale;\\n return (sin(point.x) * sin(point.y)) * 4.0;\\n}\\n\\nvoid main()\\n{\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n float average = (color.r + color.g + color.b) / 3.0;\\n gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);\\n}\\n\")||this;return r.scale=n,r.angle=t,r}return u(n,e),Object.defineProperty(n.prototype,\"scale\",{get:function(){return this.uniforms.scale},set:function(e){this.uniforms.scale=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"angle\",{get:function(){return this.uniforms.angle},set:function(e){this.uniforms.angle=e},enumerable:!1,configurable:!0}),n}(n.Filter),O=function(e){function i(o){var l=e.call(this)||this;l.angle=45,l._distance=5,l._resolution=r.settings.FILTER_RESOLUTION;var a=Object.assign(i.defaults,o),s=a.kernels,u=a.blur,c=a.quality,m=a.pixelSize,d=a.resolution;l._tintFilter=new n.Filter(f,\"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform float alpha;\\nuniform vec3 color;\\n\\nuniform vec2 shift;\\nuniform vec4 inputSize;\\n\\nvoid main(void){\\n vec4 sample = texture2D(uSampler, vTextureCoord - shift * inputSize.zw);\\n\\n // Premultiply alpha\\n sample.rgb = color.rgb * sample.a;\\n\\n // alpha user alpha\\n sample *= alpha;\\n\\n gl_FragColor = sample;\\n}\"),l._tintFilter.uniforms.color=new Float32Array(4),l._tintFilter.uniforms.shift=new t.Point,l._tintFilter.resolution=d,l._blurFilter=s?new p(s):new p(u,c),l.pixelSize=m,l.resolution=d;var h=a.shadowOnly,g=a.rotation,v=a.distance,y=a.alpha,b=a.color;return l.shadowOnly=h,l.rotation=g,l.distance=v,l.alpha=y,l.color=b,l._updatePadding(),l}return u(i,e),i.prototype.apply=function(e,n,t,r){var o=e.getFilterTexture();this._tintFilter.apply(e,n,o,1),this._blurFilter.apply(e,o,t,r),!0!==this.shadowOnly&&e.applyFilter(this,n,t,0),e.returnFilterTexture(o)},i.prototype._updatePadding=function(){this.padding=this.distance+2*this.blur},i.prototype._updateShift=function(){this._tintFilter.uniforms.shift.set(this.distance*Math.cos(this.angle),this.distance*Math.sin(this.angle))},Object.defineProperty(i.prototype,\"resolution\",{get:function(){return this._resolution},set:function(e){this._resolution=e,this._tintFilter&&(this._tintFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,\"distance\",{get:function(){return this._distance},set:function(e){this._distance=e,this._updatePadding(),this._updateShift()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,\"rotation\",{get:function(){return this.angle/t.DEG_TO_RAD},set:function(e){this.angle=e*t.DEG_TO_RAD,this._updateShift()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,\"alpha\",{get:function(){return this._tintFilter.uniforms.alpha},set:function(e){this._tintFilter.uniforms.alpha=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,\"color\",{get:function(){return o.rgb2hex(this._tintFilter.uniforms.color)},set:function(e){o.hex2rgb(e,this._tintFilter.uniforms.color)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,\"kernels\",{get:function(){return this._blurFilter.kernels},set:function(e){this._blurFilter.kernels=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,\"blur\",{get:function(){return this._blurFilter.blur},set:function(e){this._blurFilter.blur=e,this._updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,\"quality\",{get:function(){return this._blurFilter.quality},set:function(e){this._blurFilter.quality=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,\"pixelSize\",{get:function(){return this._blurFilter.pixelSize},set:function(e){this._blurFilter.pixelSize=e},enumerable:!1,configurable:!0}),i.defaults={rotation:45,distance:5,color:0,alpha:.5,shadowOnly:!1,kernels:null,blur:2,quality:3,pixelSize:1,resolution:r.settings.FILTER_RESOLUTION},i}(n.Filter),P=function(e){function n(n){void 0===n&&(n=5);var t=e.call(this,f,\"precision mediump float;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform float strength;\\nuniform vec4 filterArea;\\n\\n\\nvoid main(void)\\n{\\n\\tvec2 onePixel = vec2(1.0 / filterArea);\\n\\n\\tvec4 color;\\n\\n\\tcolor.rgb = vec3(0.5);\\n\\n\\tcolor -= texture2D(uSampler, vTextureCoord - onePixel) * strength;\\n\\tcolor += texture2D(uSampler, vTextureCoord + onePixel) * strength;\\n\\n\\tcolor.rgb = vec3((color.r + color.g + color.b) / 3.0);\\n\\n\\tfloat alpha = texture2D(uSampler, vTextureCoord).a;\\n\\n\\tgl_FragColor = vec4(color.rgb * alpha, alpha);\\n}\\n\")||this;return t.strength=n,t}return u(n,e),Object.defineProperty(n.prototype,\"strength\",{get:function(){return this.uniforms.strength},set:function(e){this.uniforms.strength=e},enumerable:!1,configurable:!0}),n}(n.Filter),A=function(e){function r(t){var o=e.call(this,f,\"// precision highp float;\\n\\nvarying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform vec4 filterArea;\\nuniform vec4 filterClamp;\\nuniform vec2 dimensions;\\nuniform float aspect;\\n\\nuniform sampler2D displacementMap;\\nuniform float offset;\\nuniform float sinDir;\\nuniform float cosDir;\\nuniform int fillMode;\\n\\nuniform float seed;\\nuniform vec2 red;\\nuniform vec2 green;\\nuniform vec2 blue;\\n\\nconst int TRANSPARENT = 0;\\nconst int ORIGINAL = 1;\\nconst int LOOP = 2;\\nconst int CLAMP = 3;\\nconst int MIRROR = 4;\\n\\nvoid main(void)\\n{\\n vec2 coord = (vTextureCoord * filterArea.xy) / dimensions;\\n\\n if (coord.x > 1.0 || coord.y > 1.0) {\\n return;\\n }\\n\\n float cx = coord.x - 0.5;\\n float cy = (coord.y - 0.5) * aspect;\\n float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;\\n\\n // displacementMap: repeat\\n // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\\n\\n // displacementMap: mirror\\n ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\\n\\n vec4 dc = texture2D(displacementMap, vec2(0.5, ny));\\n\\n float displacement = (dc.r - dc.g) * (offset / filterArea.x);\\n\\n coord = vTextureCoord + vec2(cosDir * displacement, sinDir * displacement * aspect);\\n\\n if (fillMode == CLAMP) {\\n coord = clamp(coord, filterClamp.xy, filterClamp.zw);\\n } else {\\n if( coord.x > filterClamp.z ) {\\n if (fillMode == TRANSPARENT) {\\n discard;\\n } else if (fillMode == LOOP) {\\n coord.x -= filterClamp.z;\\n } else if (fillMode == MIRROR) {\\n coord.x = filterClamp.z * 2.0 - coord.x;\\n }\\n } else if( coord.x < filterClamp.x ) {\\n if (fillMode == TRANSPARENT) {\\n discard;\\n } else if (fillMode == LOOP) {\\n coord.x += filterClamp.z;\\n } else if (fillMode == MIRROR) {\\n coord.x *= -filterClamp.z;\\n }\\n }\\n\\n if( coord.y > filterClamp.w ) {\\n if (fillMode == TRANSPARENT) {\\n discard;\\n } else if (fillMode == LOOP) {\\n coord.y -= filterClamp.w;\\n } else if (fillMode == MIRROR) {\\n coord.y = filterClamp.w * 2.0 - coord.y;\\n }\\n } else if( coord.y < filterClamp.y ) {\\n if (fillMode == TRANSPARENT) {\\n discard;\\n } else if (fillMode == LOOP) {\\n coord.y += filterClamp.w;\\n } else if (fillMode == MIRROR) {\\n coord.y *= -filterClamp.w;\\n }\\n }\\n }\\n\\n gl_FragColor.r = texture2D(uSampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\\n gl_FragColor.g = texture2D(uSampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;\\n gl_FragColor.b = texture2D(uSampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;\\n gl_FragColor.a = texture2D(uSampler, coord).a;\\n}\\n\")||this;return o.offset=100,o.fillMode=r.TRANSPARENT,o.average=!1,o.seed=0,o.minSize=8,o.sampleSize=512,o._slices=0,o._offsets=new Float32Array(1),o._sizes=new Float32Array(1),o._direction=0,o.uniforms.dimensions=new Float32Array(2),o._canvas=document.createElement(\"canvas\"),o._canvas.width=4,o._canvas.height=o.sampleSize,o.texture=n.Texture.from(o._canvas,{scaleMode:i.SCALE_MODES.NEAREST}),Object.assign(o,r.defaults,t),o}return u(r,e),r.prototype.apply=function(e,n,t,r){var o=n.filterFrame,i=o.width,l=o.height;this.uniforms.dimensions[0]=i,this.uniforms.dimensions[1]=l,this.uniforms.aspect=l/i,this.uniforms.seed=this.seed,this.uniforms.offset=this.offset,this.uniforms.fillMode=this.fillMode,e.applyFilter(this,n,t,r)},r.prototype._randomizeSizes=function(){var e=this._sizes,n=this._slices-1,t=this.sampleSize,r=Math.min(this.minSize/t,.9/this._slices);if(this.average){for(var o=this._slices,i=1,l=0;l0;n--){var t=Math.random()*n>>0,r=e[n];e[n]=e[t],e[t]=r}},r.prototype._randomizeOffsets=function(){for(var e=0;e0?e:0,s=e<0?-e:0;r.fillStyle=\"rgba(\"+a+\", \"+s+\", 0, 1)\",r.fillRect(0,o>>0,n,l+1>>0),o+=l}t.baseTexture.update(),this.uniforms.displacementMap=t},Object.defineProperty(r.prototype,\"sizes\",{get:function(){return this._sizes},set:function(e){for(var n=Math.min(this._slices,e.length),t=0;t>0)},Object.defineProperty(n.prototype,\"offset\",{get:function(){return this.uniforms.uOffset},set:function(e){this.uniforms.uOffset=e},enumerable:!1,configurable:!0}),n}(n.Filter),j=function(e){function n(n,t,r){void 0===t&&(t=.05),void 0===r&&(r=n.length);var o=e.call(this,f,\"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform float epsilon;\\n\\nconst int MAX_COLORS = %maxColors%;\\n\\nuniform vec3 originalColors[MAX_COLORS];\\nuniform vec3 targetColors[MAX_COLORS];\\n\\nvoid main(void)\\n{\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n\\n float alpha = gl_FragColor.a;\\n if (alpha < 0.0001)\\n {\\n return;\\n }\\n\\n vec3 color = gl_FragColor.rgb / alpha;\\n\\n for(int i = 0; i < MAX_COLORS; i++)\\n {\\n vec3 origColor = originalColors[i];\\n if (origColor.r < 0.0)\\n {\\n break;\\n }\\n vec3 colorDiff = origColor - color;\\n if (length(colorDiff) < epsilon)\\n {\\n vec3 targetColor = targetColors[i];\\n gl_FragColor = vec4((targetColor + colorDiff) * alpha, alpha);\\n return;\\n }\\n }\\n}\\n\".replace(/%maxColors%/g,r.toFixed(0)))||this;return o._replacements=[],o._maxColors=0,o.epsilon=t,o._maxColors=r,o.uniforms.originalColors=new Float32Array(3*r),o.uniforms.targetColors=new Float32Array(3*r),o.replacements=n,o}return u(n,e),Object.defineProperty(n.prototype,\"replacements\",{get:function(){return this._replacements},set:function(e){var n=this.uniforms.originalColors,t=this.uniforms.targetColors,r=e.length;if(r>this._maxColors)throw new Error(\"Length of replacements (\"+r+\") exceeds the maximum colors length (\"+this._maxColors+\")\");n[3*r]=-1;for(var i=0;i 0.5) then: 1 - 2 * (1 - dst) * (1 - src)\\n return vec3((dst.x <= 0.5) ? (2.0 * src.x * dst.x) : (1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)),\\n (dst.y <= 0.5) ? (2.0 * src.y * dst.y) : (1.0 - 2.0 * (1.0 - dst.y) * (1.0 - src.y)),\\n (dst.z <= 0.5) ? (2.0 * src.z * dst.z) : (1.0 - 2.0 * (1.0 - dst.z) * (1.0 - src.z)));\\n}\\n\\n\\nvoid main()\\n{\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n vec3 color = gl_FragColor.rgb;\\n\\n if (sepia > 0.0)\\n {\\n float gray = (color.x + color.y + color.z) / 3.0;\\n vec3 grayscale = vec3(gray);\\n\\n color = Overlay(SEPIA_RGB, grayscale);\\n\\n color = grayscale + sepia * (color - grayscale);\\n }\\n\\n vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy;\\n\\n if (vignetting > 0.0)\\n {\\n float outter = SQRT_2 - vignetting * SQRT_2;\\n vec2 dir = vec2(vec2(0.5, 0.5) - coord);\\n dir.y *= dimensions.y / dimensions.x;\\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\\n color.rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\\n }\\n\\n if (scratchDensity > seed && scratch != 0.0)\\n {\\n float phase = seed * 256.0;\\n float s = mod(floor(phase), 2.0);\\n float dist = 1.0 / scratchDensity;\\n float d = distance(coord, vec2(seed * dist, abs(s - seed * dist)));\\n if (d < seed * 0.6 + 0.4)\\n {\\n highp float period = scratchDensity * 10.0;\\n\\n float xx = coord.x * period + phase;\\n float aa = abs(mod(xx, 0.5) * 4.0);\\n float bb = mod(floor(xx / 0.5), 2.0);\\n float yy = (1.0 - bb) * aa + bb * (2.0 - aa);\\n\\n float kk = 2.0 * period;\\n float dw = scratchWidth / dimensions.x * (0.75 + seed);\\n float dh = dw * kk;\\n\\n float tine = (yy - (2.0 - dh));\\n\\n if (tine > 0.0) {\\n float _sign = sign(scratch);\\n\\n tine = s * tine / period + scratch + 0.1;\\n tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign * 0.5);\\n\\n color.rgb *= tine;\\n }\\n }\\n }\\n\\n if (noise > 0.0 && noiseSize > 0.0)\\n {\\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\\n // vec2 d = pixelCoord * noiseSize * vec2(1024.0 + seed * 512.0, 1024.0 - seed * 512.0);\\n // float _noise = snoise(d) * 0.5;\\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\\n color += _noise * noise;\\n }\\n\\n gl_FragColor.rgb = color;\\n}\\n\")||this;return o.seed=0,o.uniforms.dimensions=new Float32Array(2),\"number\"==typeof t?(o.seed=t,t=void 0):o.seed=r,Object.assign(o,n.defaults,t),o}return u(n,e),n.prototype.apply=function(e,n,t,r){var o,i;this.uniforms.dimensions[0]=null===(o=n.filterFrame)||void 0===o?void 0:o.width,this.uniforms.dimensions[1]=null===(i=n.filterFrame)||void 0===i?void 0:i.height,this.uniforms.seed=this.seed,e.applyFilter(this,n,t,r)},Object.defineProperty(n.prototype,\"sepia\",{get:function(){return this.uniforms.sepia},set:function(e){this.uniforms.sepia=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"noise\",{get:function(){return this.uniforms.noise},set:function(e){this.uniforms.noise=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"noiseSize\",{get:function(){return this.uniforms.noiseSize},set:function(e){this.uniforms.noiseSize=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"scratch\",{get:function(){return this.uniforms.scratch},set:function(e){this.uniforms.scratch=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"scratchDensity\",{get:function(){return this.uniforms.scratchDensity},set:function(e){this.uniforms.scratchDensity=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"scratchWidth\",{get:function(){return this.uniforms.scratchWidth},set:function(e){this.uniforms.scratchWidth=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"vignetting\",{get:function(){return this.uniforms.vignetting},set:function(e){this.uniforms.vignetting=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"vignettingAlpha\",{get:function(){return this.uniforms.vignettingAlpha},set:function(e){this.uniforms.vignettingAlpha=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"vignettingBlur\",{get:function(){return this.uniforms.vignettingBlur},set:function(e){this.uniforms.vignettingBlur=e},enumerable:!1,configurable:!0}),n.defaults={sepia:.3,noise:.3,noiseSize:1,scratch:.5,scratchDensity:.3,scratchWidth:1,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3},n}(n.Filter),R=function(e){function n(t,r,o){void 0===t&&(t=1),void 0===r&&(r=0),void 0===o&&(o=.1);var i=e.call(this,f,\"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform vec2 thickness;\\nuniform vec4 outlineColor;\\nuniform vec4 filterClamp;\\n\\nconst float DOUBLE_PI = 3.14159265358979323846264 * 2.;\\n\\nvoid main(void) {\\n vec4 ownColor = texture2D(uSampler, vTextureCoord);\\n vec4 curColor;\\n float maxAlpha = 0.;\\n vec2 displaced;\\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ${angleStep}) {\\n displaced.x = vTextureCoord.x + thickness.x * cos(angle);\\n displaced.y = vTextureCoord.y + thickness.y * sin(angle);\\n curColor = texture2D(uSampler, clamp(displaced, filterClamp.xy, filterClamp.zw));\\n maxAlpha = max(maxAlpha, curColor.a);\\n }\\n float resultAlpha = max(maxAlpha, ownColor.a);\\n gl_FragColor = vec4((ownColor.rgb + outlineColor.rgb * (1. - ownColor.a)) * resultAlpha, resultAlpha);\\n}\\n\".replace(/\\$\\{angleStep\\}/,n.getAngleStep(o)))||this;return i._thickness=1,i.uniforms.thickness=new Float32Array([0,0]),i.uniforms.outlineColor=new Float32Array([0,0,0,1]),Object.assign(i,{thickness:t,color:r,quality:o}),i}return u(n,e),n.getAngleStep=function(e){var t=Math.max(e*n.MAX_SAMPLES,n.MIN_SAMPLES);return(2*Math.PI/t).toFixed(7)},n.prototype.apply=function(e,n,t,r){this.uniforms.thickness[0]=this._thickness/n._frame.width,this.uniforms.thickness[1]=this._thickness/n._frame.height,e.applyFilter(this,n,t,r)},Object.defineProperty(n.prototype,\"color\",{get:function(){return o.rgb2hex(this.uniforms.outlineColor)},set:function(e){o.hex2rgb(e,this.uniforms.outlineColor)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"thickness\",{get:function(){return this._thickness},set:function(e){this._thickness=e,this.padding=e},enumerable:!1,configurable:!0}),n.MIN_SAMPLES=1,n.MAX_SAMPLES=100,n}(n.Filter),E=function(e){function n(n){void 0===n&&(n=10);var t=e.call(this,f,\"precision mediump float;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform vec2 size;\\nuniform sampler2D uSampler;\\n\\nuniform vec4 filterArea;\\n\\nvec2 mapCoord( vec2 coord )\\n{\\n coord *= filterArea.xy;\\n coord += filterArea.zw;\\n\\n return coord;\\n}\\n\\nvec2 unmapCoord( vec2 coord )\\n{\\n coord -= filterArea.zw;\\n coord /= filterArea.xy;\\n\\n return coord;\\n}\\n\\nvec2 pixelate(vec2 coord, vec2 size)\\n{\\n\\treturn floor( coord / size ) * size;\\n}\\n\\nvoid main(void)\\n{\\n vec2 coord = mapCoord(vTextureCoord);\\n\\n coord = pixelate(coord, size);\\n\\n coord = unmapCoord(coord);\\n\\n gl_FragColor = texture2D(uSampler, coord);\\n}\\n\")||this;return t.size=n,t}return u(n,e),Object.defineProperty(n.prototype,\"size\",{get:function(){return this.uniforms.size},set:function(e){\"number\"==typeof e&&(e=[e,e]),this.uniforms.size=e},enumerable:!1,configurable:!0}),n}(n.Filter),I=function(e){function n(n,t,r,o){void 0===n&&(n=0),void 0===t&&(t=[0,0]),void 0===r&&(r=5),void 0===o&&(o=-1);var i=e.call(this,f,\"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\n\\nuniform float uRadian;\\nuniform vec2 uCenter;\\nuniform float uRadius;\\nuniform int uKernelSize;\\n\\nconst int MAX_KERNEL_SIZE = 2048;\\n\\nvoid main(void)\\n{\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n\\n if (uKernelSize == 0)\\n {\\n gl_FragColor = color;\\n return;\\n }\\n\\n float aspect = filterArea.y / filterArea.x;\\n vec2 center = uCenter.xy / filterArea.xy;\\n float gradient = uRadius / filterArea.x * 0.3;\\n float radius = uRadius / filterArea.x - gradient * 0.5;\\n int k = uKernelSize - 1;\\n\\n vec2 coord = vTextureCoord;\\n vec2 dir = vec2(center - coord);\\n float dist = length(vec2(dir.x, dir.y * aspect));\\n\\n float radianStep = uRadian;\\n if (radius >= 0.0 && dist > radius) {\\n float delta = dist - radius;\\n float gap = gradient;\\n float scale = 1.0 - abs(delta / gap);\\n if (scale <= 0.0) {\\n gl_FragColor = color;\\n return;\\n }\\n radianStep *= scale;\\n }\\n radianStep /= float(k);\\n\\n float s = sin(radianStep);\\n float c = cos(radianStep);\\n mat2 rotationMatrix = mat2(vec2(c, -s), vec2(s, c));\\n\\n for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) {\\n if (i == k) {\\n break;\\n }\\n\\n coord -= center;\\n coord.y *= aspect;\\n coord = rotationMatrix * coord;\\n coord.y /= aspect;\\n coord += center;\\n\\n vec4 sample = texture2D(uSampler, coord);\\n\\n // switch to pre-multiplied alpha to correctly blur transparent images\\n // sample.rgb *= sample.a;\\n\\n color += sample;\\n }\\n\\n gl_FragColor = color / float(uKernelSize);\\n}\\n\")||this;return i._angle=0,i.angle=n,i.center=t,i.kernelSize=r,i.radius=o,i}return u(n,e),n.prototype.apply=function(e,n,t,r){this.uniforms.uKernelSize=0!==this._angle?this.kernelSize:0,e.applyFilter(this,n,t,r)},Object.defineProperty(n.prototype,\"angle\",{get:function(){return this._angle},set:function(e){this._angle=e,this.uniforms.uRadian=e*Math.PI/180},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"center\",{get:function(){return this.uniforms.uCenter},set:function(e){this.uniforms.uCenter=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"radius\",{get:function(){return this.uniforms.uRadius},set:function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},enumerable:!1,configurable:!0}),n}(n.Filter),k=function(e){function n(t){var r=e.call(this,f,\"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform vec4 filterArea;\\nuniform vec4 filterClamp;\\nuniform vec2 dimensions;\\n\\nuniform bool mirror;\\nuniform float boundary;\\nuniform vec2 amplitude;\\nuniform vec2 waveLength;\\nuniform vec2 alpha;\\nuniform float time;\\n\\nfloat rand(vec2 co) {\\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\\n}\\n\\nvoid main(void)\\n{\\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\\n vec2 coord = pixelCoord / dimensions;\\n\\n if (coord.y < boundary) {\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n return;\\n }\\n\\n float k = (coord.y - boundary) / (1. - boundary + 0.0001);\\n float areaY = boundary * dimensions.y / filterArea.y;\\n float v = areaY + areaY - vTextureCoord.y;\\n float y = mirror ? v : vTextureCoord.y;\\n\\n float _amplitude = ((amplitude.y - amplitude.x) * k + amplitude.x ) / filterArea.x;\\n float _waveLength = ((waveLength.y - waveLength.x) * k + waveLength.x) / filterArea.y;\\n float _alpha = (alpha.y - alpha.x) * k + alpha.x;\\n\\n float x = vTextureCoord.x + cos(v * 6.28 / _waveLength - time) * _amplitude;\\n x = clamp(x, filterClamp.x, filterClamp.z);\\n\\n vec4 color = texture2D(uSampler, vec2(x, y));\\n\\n gl_FragColor = color * _alpha;\\n}\\n\")||this;return r.time=0,r.uniforms.amplitude=new Float32Array(2),r.uniforms.waveLength=new Float32Array(2),r.uniforms.alpha=new Float32Array(2),r.uniforms.dimensions=new Float32Array(2),Object.assign(r,n.defaults,t),r}return u(n,e),n.prototype.apply=function(e,n,t,r){var o,i;this.uniforms.dimensions[0]=null===(o=n.filterFrame)||void 0===o?void 0:o.width,this.uniforms.dimensions[1]=null===(i=n.filterFrame)||void 0===i?void 0:i.height,this.uniforms.time=this.time,e.applyFilter(this,n,t,r)},Object.defineProperty(n.prototype,\"mirror\",{get:function(){return this.uniforms.mirror},set:function(e){this.uniforms.mirror=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"boundary\",{get:function(){return this.uniforms.boundary},set:function(e){this.uniforms.boundary=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"amplitude\",{get:function(){return this.uniforms.amplitude},set:function(e){this.uniforms.amplitude[0]=e[0],this.uniforms.amplitude[1]=e[1]},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"waveLength\",{get:function(){return this.uniforms.waveLength},set:function(e){this.uniforms.waveLength[0]=e[0],this.uniforms.waveLength[1]=e[1]},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"alpha\",{get:function(){return this.uniforms.alpha},set:function(e){this.uniforms.alpha[0]=e[0],this.uniforms.alpha[1]=e[1]},enumerable:!1,configurable:!0}),n.defaults={mirror:!0,boundary:.5,amplitude:[0,20],waveLength:[30,100],alpha:[1,1],time:0},n}(n.Filter),L=function(e){function n(n,t,r){void 0===n&&(n=[-10,0]),void 0===t&&(t=[0,10]),void 0===r&&(r=[0,0]);var o=e.call(this,f,\"precision mediump float;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\nuniform vec2 red;\\nuniform vec2 green;\\nuniform vec2 blue;\\n\\nvoid main(void)\\n{\\n gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/filterArea.xy).r;\\n gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/filterArea.xy).g;\\n gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/filterArea.xy).b;\\n gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;\\n}\\n\")||this;return o.red=n,o.green=t,o.blue=r,o}return u(n,e),Object.defineProperty(n.prototype,\"red\",{get:function(){return this.uniforms.red},set:function(e){this.uniforms.red=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"green\",{get:function(){return this.uniforms.green},set:function(e){this.uniforms.green=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"blue\",{get:function(){return this.uniforms.blue},set:function(e){this.uniforms.blue=e},enumerable:!1,configurable:!0}),n}(n.Filter),N=function(e){function n(t,r,o){void 0===t&&(t=[0,0]),void 0===o&&(o=0);var i=e.call(this,f,\"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\nuniform vec4 filterClamp;\\n\\nuniform vec2 center;\\n\\nuniform float amplitude;\\nuniform float wavelength;\\n// uniform float power;\\nuniform float brightness;\\nuniform float speed;\\nuniform float radius;\\n\\nuniform float time;\\n\\nconst float PI = 3.14159;\\n\\nvoid main()\\n{\\n float halfWavelength = wavelength * 0.5 / filterArea.x;\\n float maxRadius = radius / filterArea.x;\\n float currentRadius = time * speed / filterArea.x;\\n\\n float fade = 1.0;\\n\\n if (maxRadius > 0.0) {\\n if (currentRadius > maxRadius) {\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n return;\\n }\\n fade = 1.0 - pow(currentRadius / maxRadius, 2.0);\\n }\\n\\n vec2 dir = vec2(vTextureCoord - center / filterArea.xy);\\n dir.y *= filterArea.y / filterArea.x;\\n float dist = length(dir);\\n\\n if (dist <= 0.0 || dist < currentRadius - halfWavelength || dist > currentRadius + halfWavelength) {\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n return;\\n }\\n\\n vec2 diffUV = normalize(dir);\\n\\n float diff = (dist - currentRadius) / halfWavelength;\\n\\n float p = 1.0 - pow(abs(diff), 2.0);\\n\\n // float powDiff = diff * pow(p, 2.0) * ( amplitude * fade );\\n float powDiff = 1.25 * sin(diff * PI) * p * ( amplitude * fade );\\n\\n vec2 offset = diffUV * powDiff / filterArea.xy;\\n\\n // Do clamp :\\n vec2 coord = vTextureCoord + offset;\\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\\n vec4 color = texture2D(uSampler, clampedCoord);\\n if (coord != clampedCoord) {\\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\\n }\\n\\n // No clamp :\\n // gl_FragColor = texture2D(uSampler, vTextureCoord + offset);\\n\\n color.rgb *= 1.0 + (brightness - 1.0) * p * fade;\\n\\n gl_FragColor = color;\\n}\\n\")||this;return i.center=t,Object.assign(i,n.defaults,r),i.time=o,i}return u(n,e),n.prototype.apply=function(e,n,t,r){this.uniforms.time=this.time,e.applyFilter(this,n,t,r)},Object.defineProperty(n.prototype,\"center\",{get:function(){return this.uniforms.center},set:function(e){this.uniforms.center=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"amplitude\",{get:function(){return this.uniforms.amplitude},set:function(e){this.uniforms.amplitude=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"wavelength\",{get:function(){return this.uniforms.wavelength},set:function(e){this.uniforms.wavelength=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"brightness\",{get:function(){return this.uniforms.brightness},set:function(e){this.uniforms.brightness=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"speed\",{get:function(){return this.uniforms.speed},set:function(e){this.uniforms.speed=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"radius\",{get:function(){return this.uniforms.radius},set:function(e){this.uniforms.radius=e},enumerable:!1,configurable:!0}),n.defaults={amplitude:30,wavelength:160,brightness:1,speed:500,radius:-1},n}(n.Filter),X=function(e){function n(n,t,r){void 0===t&&(t=0),void 0===r&&(r=1);var o=e.call(this,f,\"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform sampler2D uLightmap;\\nuniform vec4 filterArea;\\nuniform vec2 dimensions;\\nuniform vec4 ambientColor;\\nvoid main() {\\n vec4 diffuseColor = texture2D(uSampler, vTextureCoord);\\n vec2 lightCoord = (vTextureCoord * filterArea.xy) / dimensions;\\n vec4 light = texture2D(uLightmap, lightCoord);\\n vec3 ambient = ambientColor.rgb * ambientColor.a;\\n vec3 intensity = ambient + light.rgb;\\n vec3 finalColor = diffuseColor.rgb * intensity;\\n gl_FragColor = vec4(finalColor, diffuseColor.a);\\n}\\n\")||this;return o._color=0,o.uniforms.dimensions=new Float32Array(2),o.uniforms.ambientColor=new Float32Array([0,0,0,r]),o.texture=n,o.color=t,o}return u(n,e),n.prototype.apply=function(e,n,t,r){var o,i;this.uniforms.dimensions[0]=null===(o=n.filterFrame)||void 0===o?void 0:o.width,this.uniforms.dimensions[1]=null===(i=n.filterFrame)||void 0===i?void 0:i.height,e.applyFilter(this,n,t,r)},Object.defineProperty(n.prototype,\"texture\",{get:function(){return this.uniforms.uLightmap},set:function(e){this.uniforms.uLightmap=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"color\",{get:function(){return this._color},set:function(e){var n=this.uniforms.ambientColor;\"number\"==typeof e?(o.hex2rgb(e,n),this._color=e):(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],this._color=o.rgb2hex(n))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"alpha\",{get:function(){return this.uniforms.ambientColor[3]},set:function(e){this.uniforms.ambientColor[3]=e},enumerable:!1,configurable:!0}),n}(n.Filter),B=function(e){function n(n,r,o,i){void 0===n&&(n=100),void 0===r&&(r=600);var l=e.call(this,f,\"varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform float blur;\\nuniform float gradientBlur;\\nuniform vec2 start;\\nuniform vec2 end;\\nuniform vec2 delta;\\nuniform vec2 texSize;\\n\\nfloat random(vec3 scale, float seed)\\n{\\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\\n}\\n\\nvoid main(void)\\n{\\n vec4 color = vec4(0.0);\\n float total = 0.0;\\n\\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\\n float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;\\n\\n for (float t = -30.0; t <= 30.0; t++)\\n {\\n float percent = (t + offset - 0.5) / 30.0;\\n float weight = 1.0 - abs(percent);\\n vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);\\n sample.rgb *= sample.a;\\n color += sample * weight;\\n total += weight;\\n }\\n\\n color /= total;\\n color.rgb /= color.a + 0.00001;\\n\\n gl_FragColor = color;\\n}\\n\")||this;return l.uniforms.blur=n,l.uniforms.gradientBlur=r,l.uniforms.start=o||new t.Point(0,window.innerHeight/2),l.uniforms.end=i||new t.Point(600,window.innerHeight/2),l.uniforms.delta=new t.Point(30,30),l.uniforms.texSize=new t.Point(window.innerWidth,window.innerHeight),l.updateDelta(),l}return u(n,e),n.prototype.updateDelta=function(){this.uniforms.delta.x=0,this.uniforms.delta.y=0},Object.defineProperty(n.prototype,\"blur\",{get:function(){return this.uniforms.blur},set:function(e){this.uniforms.blur=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"gradientBlur\",{get:function(){return this.uniforms.gradientBlur},set:function(e){this.uniforms.gradientBlur=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"start\",{get:function(){return this.uniforms.start},set:function(e){this.uniforms.start=e,this.updateDelta()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"end\",{get:function(){return this.uniforms.end},set:function(e){this.uniforms.end=e,this.updateDelta()},enumerable:!1,configurable:!0}),n}(n.Filter),G=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return u(n,e),n.prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,n=this.uniforms.end.y-this.uniforms.start.y,t=Math.sqrt(e*e+n*n);this.uniforms.delta.x=e/t,this.uniforms.delta.y=n/t},n}(B),K=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return u(n,e),n.prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,n=this.uniforms.end.y-this.uniforms.start.y,t=Math.sqrt(e*e+n*n);this.uniforms.delta.x=-n/t,this.uniforms.delta.y=e/t},n}(B),q=function(e){function n(n,t,r,o){void 0===n&&(n=100),void 0===t&&(t=600);var i=e.call(this)||this;return i.tiltShiftXFilter=new G(n,t,r,o),i.tiltShiftYFilter=new K(n,t,r,o),i}return u(n,e),n.prototype.apply=function(e,n,t,r){var o=e.getFilterTexture();this.tiltShiftXFilter.apply(e,n,o,1),this.tiltShiftYFilter.apply(e,o,t,r),e.returnFilterTexture(o)},Object.defineProperty(n.prototype,\"blur\",{get:function(){return this.tiltShiftXFilter.blur},set:function(e){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"gradientBlur\",{get:function(){return this.tiltShiftXFilter.gradientBlur},set:function(e){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"start\",{get:function(){return this.tiltShiftXFilter.start},set:function(e){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"end\",{get:function(){return this.tiltShiftXFilter.end},set:function(e){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=e},enumerable:!1,configurable:!0}),n}(n.Filter),W=function(e){function n(t){var r=e.call(this,f,\"varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform float radius;\\nuniform float angle;\\nuniform vec2 offset;\\nuniform vec4 filterArea;\\n\\nvec2 mapCoord( vec2 coord )\\n{\\n coord *= filterArea.xy;\\n coord += filterArea.zw;\\n\\n return coord;\\n}\\n\\nvec2 unmapCoord( vec2 coord )\\n{\\n coord -= filterArea.zw;\\n coord /= filterArea.xy;\\n\\n return coord;\\n}\\n\\nvec2 twist(vec2 coord)\\n{\\n coord -= offset;\\n\\n float dist = length(coord);\\n\\n if (dist < radius)\\n {\\n float ratioDist = (radius - dist) / radius;\\n float angleMod = ratioDist * ratioDist * angle;\\n float s = sin(angleMod);\\n float c = cos(angleMod);\\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\\n }\\n\\n coord += offset;\\n\\n return coord;\\n}\\n\\nvoid main(void)\\n{\\n\\n vec2 coord = mapCoord(vTextureCoord);\\n\\n coord = twist(coord);\\n\\n coord = unmapCoord(coord);\\n\\n gl_FragColor = texture2D(uSampler, coord );\\n\\n}\\n\")||this;return Object.assign(r,n.defaults,t),r}return u(n,e),Object.defineProperty(n.prototype,\"offset\",{get:function(){return this.uniforms.offset},set:function(e){this.uniforms.offset=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"radius\",{get:function(){return this.uniforms.radius},set:function(e){this.uniforms.radius=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"angle\",{get:function(){return this.uniforms.angle},set:function(e){this.uniforms.angle=e},enumerable:!1,configurable:!0}),n.defaults={radius:200,angle:4,padding:20,offset:new t.Point},n}(n.Filter),Y=function(e){function n(t){var r,o=Object.assign(n.defaults,t),i=o.maxKernelSize,l=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&\"function\"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o= 0.0 && dist > radius) { // radius < 0 means it's infinity\\n delta = dist - radius;\\n gap = gradient;\\n }\\n\\n if (delta > 0.0) {\\n float normalCount = gap / filterArea.x;\\n delta = (normalCount - delta) / normalCount;\\n countLimit *= delta;\\n strength *= delta;\\n if (countLimit < 1.0)\\n {\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n return;\\n }\\n }\\n\\n // randomize the lookup values to hide the fixed number of samples\\n float offset = rand(vTextureCoord, 0.0);\\n\\n float total = 0.0;\\n vec4 color = vec4(0.0);\\n\\n dir *= strength;\\n\\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\\n float percent = (t + offset) / MAX_KERNEL_SIZE;\\n float weight = 4.0 * (percent - percent * percent);\\n vec2 p = vTextureCoord + dir * percent;\\n vec4 sample = texture2D(uSampler, p);\\n\\n // switch to pre-multiplied alpha to correctly blur transparent images\\n // sample.rgb *= sample.a;\\n\\n color += sample * weight;\\n total += weight;\\n\\n if (t > countLimit){\\n break;\\n }\\n }\\n\\n color /= total;\\n // switch back from pre-multiplied alpha\\n // color.rgb /= color.a + 0.00001;\\n\\n gl_FragColor = color;\\n}\\n\".replace(\"${maxKernelSize}\",i.toFixed(1)))||this,Object.assign(r,l),r}return u(n,e),Object.defineProperty(n.prototype,\"center\",{get:function(){return this.uniforms.uCenter},set:function(e){this.uniforms.uCenter=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"strength\",{get:function(){return this.uniforms.uStrength},set:function(e){this.uniforms.uStrength=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"innerRadius\",{get:function(){return this.uniforms.uInnerRadius},set:function(e){this.uniforms.uInnerRadius=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"radius\",{get:function(){return this.uniforms.uRadius},set:function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},enumerable:!1,configurable:!0}),n.defaults={strength:.1,center:[0,0],innerRadius:0,radius:-1,maxKernelSize:32},n}(n.Filter);return e.AdjustmentFilter=c,e.AdvancedBloomFilter=d,e.AsciiFilter=h,e.BevelFilter=g,e.BloomFilter=v,e.BulgePinchFilter=y,e.CRTFilter=F,e.ColorMapFilter=b,e.ColorOverlayFilter=x,e.ColorReplaceFilter=_,e.ConvolutionFilter=C,e.CrossHatchFilter=S,e.DotFilter=z,e.DropShadowFilter=O,e.EmbossFilter=P,e.GlitchFilter=A,e.GlowFilter=T,e.GodrayFilter=w,e.KawaseBlurFilter=p,e.MotionBlurFilter=D,e.MultiColorReplaceFilter=j,e.OldFilmFilter=M,e.OutlineFilter=R,e.PixelateFilter=E,e.RGBSplitFilter=L,e.RadialBlurFilter=I,e.ReflectionFilter=k,e.ShockwaveFilter=N,e.SimpleLightmapFilter=X,e.TiltShiftAxisFilter=B,e.TiltShiftFilter=q,e.TiltShiftXFilter=G,e.TiltShiftYFilter=K,e.TwistFilter=W,e.ZoomBlurFilter=Y,Object.defineProperty(e,\"__esModule\",{value:!0}),e}({},PIXI,PIXI,PIXI,PIXI.utils,PIXI,PIXI.filters,PIXI.filters);Object.assign(PIXI.filters,__filters);\n", "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": true } ], "parameters": [], "objectGroups": [] } ], "eventsBasedBehaviors": [ { "description": "", "fullName": "", "name": "SpriteStack", "objectType": "", "eventsFunctions": [ { "description": "", "fullName": "", "functionType": "Action", "name": "onCreated", "private": false, "sentence": "", "events": [ { "disabled": false, "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { "inverted": false, "value": "BuiltinCommonInstructions::Once" }, "parameters": [], "subInstructions": [] } ], "actions": [ { "type": { "inverted": false, "value": "SpriteStack::SpriteStack::SetPropertyDensity" }, "parameters": [ "Object", "Behavior", "=", "Variable(DENSITY_STACK)" ], "subInstructions": [] } ], "events": [ { "disabled": false, "folded": false, "type": "BuiltinCommonInstructions::JsCode", "inlineCode": "let _o = objects[0]\nlet __o = _o.getRendererObject()\nlet controller = _o.getBehavior(\"SpriteStack\")\nlet ISO = new PIXI.Container();\nlet container = new PIXI.Container();\nlet data = controller._behaviorData\nlet scale = data.Scale \nlet slice = scale * data.Density //set 0 to no fill\nlet ISOMETRIC = runtimeScene.getVariables().get(\"CAMERA_STACK\").getValue() == 1 ? true : false\n// let shadow = new PIXI.Container();\n__o.addChild(ISO)\n// __o.addChild(shadow)\nISO.addChild(container)\n// ISO.addChild(shadow)\n// ISO.cacheAsBitmap = true\n// ISO.zIndex = 1\n// shadow.zIndex = -100000\n// let colorMatrix = new PIXI.filters.ColorMatrixFilter();\n// shadow.filters = [colorMatrix];\n// colorMatrix.greyscale();\n// colorMatrix.alpha = 0.2\n// shadow.alpha = 0.2\n\nconst makeShadow = (spr, scale, density,x = false, y=false) =>{\n let _sh = new PIXI.Sprite(spr.texture)\n let CACHE = 1\n _sh.anchor.set(\n 0.51,\n 0.52\n );\n _sh.scale.x = scale \n _sh.scale.y = scale \n _sh.tint = 0x000000 //Math.random() * 0x808080;\n // _sh.filters = [ new PIXI.filters.FXAAFilter() ]\n _sh.position.set(\n (x ? x : spr.position.x) - density,\n (y ? y : spr.position.y) - density\n )\n _sh.blendMode = 5\n _sh.alpha = .05\n _sh.cacheAsBitmap = CACHE ? true : false\n return _sh\n}\n\nlet frames = _o._animations[1].directions[0].frames.reverse()\nframes.forEach( fr =>{\n let sprite = new PIXI.Sprite(fr.texture)\n sprite.anchor.set(0.5, 0.5)\n sprite.scale.x = scale\n sprite.scale.y = scale\n container.addChild(sprite)\n\n})\n\nlet c_size = container.children.length\nfor (var e = 0; e < c_size; e++) {\n let o = container.children[e]\n let size = (e * scale) * - (ISOMETRIC ? 1 : 0.45) //calculate extrude space\n o.position.set(size, size)\n if(!slice && false)\n container.addChild(makeShadow(o, scale, 1))// Simple draw\n \n for (var t = 0; t < slice; t++) {\n let _x = new PIXI.Sprite(o.texture)\n _x.anchor.set(0.5, 0.5);\n _x.scale.x = scale\n _x.scale.y = scale\n let density = t/slice\n _x.position.set(\n o.position.x - density,\n o.position.y - density\n )\n container.addChild(makeShadow(o, scale, density))\n // container.addChild(makeShadow(o, scale, density+.1))\n // container.addChild(makeShadow(o, scale, density+.2))\n // container.addChild(makeShadow(o, scale, density+.3))\n // container.addChild(makeShadow(o, scale, density+.4))\n container.addChild(_x)\n }\n}\n\n\n\n// container.children.forEach(obj => obj.zIndex = obj.y )", "parameterObjects": "Object", "useStrict": true, "eventsSheetExpanded": true } ] } ], "parameters": [ { "codeOnly": false, "defaultValue": "", "description": "Object", "longDescription": "", "name": "Object", "optional": false, "supplementaryInformation": "", "type": "object" }, { "codeOnly": false, "defaultValue": "", "description": "Behavior", "longDescription": "", "name": "Behavior", "optional": false, "supplementaryInformation": "SpriteStack::SpriteStack", "type": "behavior" } ], "objectGroups": [] }, { "description": "", "fullName": "", "functionType": "Action", "name": "doStepPreEvents", "private": false, "sentence": "", "events": [ { "disabled": false, "folded": false, "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { "inverted": false, "value": "SetAngle" }, "parameters": [ "Object", "=", "CameraAngle()" ], "subInstructions": [] }, { "type": { "inverted": false, "value": "SpriteStack::SpriteStack::SetPropertyAngle" }, "parameters": [ "Object", "Behavior", "=", "-CameraAngle()" ], "subInstructions": [] } ], "events": [] }, { "disabled": false, "folded": false, "type": "BuiltinCommonInstructions::JsCode", "inlineCode": "let _o = objects[0] // GD object\nlet __o = _o.getRendererObject() // Pixi Object\nlet _c = __o.children[0].children[0] //Child\n// let _s = __o.children[1]//.children[0] //Child\nlet __c = _o.getBehavior(\"SpriteStack\") // Controller\nlet _d = __c._behaviorData // Controller Variables\nlet ISOMETRIC = runtimeScene.getVariables().get(\"CAMERA_STACK\").getValue() == 1 ? true : false\nlet layer = runtimeScene.getLayer()\n\n// console.log(_s)\n/*\ncheck filters\nto-do:\n - remove filters when outline unchecked \n*/\nif(!_c.filters && _d.Outline && PIXI.filters.OutlineFilter) \n _c.filters = [new PIXI.filters.OutlineFilter(_d.OutlineSize)]\nif(PIXI.filters.PixelateFilter)\n _c.filters = [ \n // new PIXI.filters.PixelateFilter(1) \n ]\nif(ISOMETRIC) //set isometric perspect\n{\n _c.angle = 45\n // _s.angle = 45 \n} \n\n/*\n Normalize angle between 0-360\n*/\nlet orientation = _d.Angle \norientation = orientation % 360\nif (orientation < 0)\n orientation += 360\n\n_c.children.forEach(obj => {\n if(obj.tint){\n obj.filters = [ \n // new PIXI.filters.PixelateFilter(1) \n // new PIXI.filters.OutlineFilter(1)\n ]\n }\n obj.angle = orientation + (ISOMETRIC ? -45: 0)\n obj.angle += -_o.getVariables().get(\"angle\").getValue() * -1 //add rotation with offset angle from object vars\n})\n// _s.children.forEach(sh => {\n// sh.angle = orientation + (ISOMETRIC ? -45: 0)\n// sh.angle += -_o.getVariables().get(\"angle\").getValue() * -1 //add rotation with offset angle from object vars\n// })\n// _s.setZOrder(-10000)\n/*\n calculate camera pointo to estimate zOrder\n*/\nvar r = 2000\nlet rotation = layer.getCameraRotation() + 90\nlet rot = gdjs.toRad(rotation)\n\nvar dx = r * Math.cos(rot);\nvar dy = r * Math.sin(rot);\nlet obj = objects[0]\n\nlet x2 = layer.getCameraX() + dx\nlet y2 = layer.getCameraY() + dy\nlet rmZ = parseFloat(_o.getVariables().get(\"z\").getValue()) || 0 //remove z\nlet distance = _o.getDistanceToPosition(x2,y2) + rmZ \n_o.setZOrder(distance * -1)\n", "parameterObjects": "Object", "useStrict": true, "eventsSheetExpanded": true } ], "parameters": [ { "codeOnly": false, "defaultValue": "", "description": "Object", "longDescription": "", "name": "Object", "optional": false, "supplementaryInformation": "", "type": "object" }, { "codeOnly": false, "defaultValue": "", "description": "Behavior", "longDescription": "", "name": "Behavior", "optional": false, "supplementaryInformation": "SpriteStack::SpriteStack", "type": "behavior" } ], "objectGroups": [] }, { "description": "", "fullName": "Get Rotation", "functionType": "Expression", "name": "GetRotation", "private": false, "sentence": "", "events": [ { "disabled": false, "folded": false, "type": "BuiltinCommonInstructions::JsCode", "inlineCode": "let _o = objects[0] // GD object\nlet __o = _o.getRendererObject() // Pixi Object\nlet _c = __o.children[0].children[0] //Child\nlet __c = _o.getBehavior(\"SpriteStack\") // Controller\nlet _d = __c._behaviorData // Controller Variables\neventsFunctionContext.returnValue = _d.Angle", "parameterObjects": "Object", "useStrict": true, "eventsSheetExpanded": false } ], "parameters": [ { "codeOnly": false, "defaultValue": "", "description": "Object", "longDescription": "", "name": "Object", "optional": false, "supplementaryInformation": "", "type": "object" }, { "codeOnly": false, "defaultValue": "", "description": "Behavior", "longDescription": "", "name": "Behavior", "optional": false, "supplementaryInformation": "SpriteStack::SpriteStack", "type": "behavior" } ], "objectGroups": [] }, { "description": "", "fullName": "Set Rotation", "functionType": "Action", "name": "SetRotation", "private": false, "sentence": "Set rotation of _PARAM0_ of _PARAM2_ ", "events": [ { "disabled": false, "folded": false, "type": "BuiltinCommonInstructions::JsCode", "inlineCode": "let _o = objects[0] // GD object\nlet __o = _o.getRendererObject() // Pixi Object\nlet _c = __o.children[0].children[0] //Child\nlet __c = _o.getBehavior(\"SpriteStack\") // Controller\nlet _d = __c._behaviorData // Controller Variables\nlet ang = parseFloat(eventsFunctionContext.getArgument(\"Angle\"))\nlet off = parseFloat(_d.AngleOffset)\n_d.Angle = ang\n", "parameterObjects": "Object", "useStrict": true, "eventsSheetExpanded": true } ], "parameters": [ { "codeOnly": false, "defaultValue": "", "description": "Object", "longDescription": "", "name": "Object", "optional": false, "supplementaryInformation": "", "type": "object" }, { "codeOnly": false, "defaultValue": "", "description": "Behavior", "longDescription": "", "name": "Behavior", "optional": false, "supplementaryInformation": "SpriteStack::SpriteStack", "type": "behavior" }, { "codeOnly": false, "defaultValue": "", "description": "", "longDescription": "", "name": "Angle", "optional": false, "supplementaryInformation": "", "type": "expression" } ], "objectGroups": [] }, { "description": "", "fullName": "Add Rodation", "functionType": "Action", "name": "AddRotation", "private": false, "sentence": "Add rotation of _PARAM0_ in _PARAM2_ ", "events": [ { "disabled": false, "folded": false, "type": "BuiltinCommonInstructions::JsCode", "inlineCode": "let _o = objects[0] // GD object\nlet __o = _o.getRendererObject() // Pixi Object\nlet _c = __o.children[0].children[0] //Child\nlet __c = _o.getBehavior(\"SpriteStack\") // Controller\nlet _d = __c._behaviorData // Controller Variables\nlet ang = parseFloat(eventsFunctionContext.getArgument(\"Angle\"))\nlet off = parseFloat(_d.AngleOffset)\nlet ISOMETRIC = runtimeScene.getVariables().get(\"CAMERA_STACK\").getValue() == 1 ? true : false\n_d.Angle += ang \n", "parameterObjects": "Object", "useStrict": true, "eventsSheetExpanded": true } ], "parameters": [ { "codeOnly": false, "defaultValue": "", "description": "Object", "longDescription": "", "name": "Object", "optional": false, "supplementaryInformation": "", "type": "object" }, { "codeOnly": false, "defaultValue": "", "description": "Behavior", "longDescription": "", "name": "Behavior", "optional": false, "supplementaryInformation": "SpriteStack::SpriteStack", "type": "behavior" }, { "codeOnly": false, "defaultValue": "", "description": "", "longDescription": "", "name": "Angle", "optional": false, "supplementaryInformation": "", "type": "expression" } ], "objectGroups": [] } ], "propertyDescriptors": [ { "value": "1", "type": "Number", "label": "Object scale multiplier", "description": "", "extraInformation": [], "hidden": false, "name": "Scale" }, { "value": "0", "type": "Number", "label": "", "description": "", "extraInformation": [], "hidden": true, "name": "Density" }, { "value": "0", "type": "Number", "label": "Angle", "description": "", "extraInformation": [], "hidden": true, "name": "Angle" }, { "value": "0", "type": "Number", "label": "Angle Offset", "description": "", "extraInformation": [], "hidden": false, "name": "AngleOffset" }, { "value": "", "type": "Boolean", "label": "", "description": "", "extraInformation": [], "hidden": false, "name": "Outline" }, { "value": "1", "type": "Number", "label": "", "description": "", "extraInformation": [], "hidden": false, "name": "OutlineSize" }, { "value": "", "type": "Boolean", "label": "", "description": "", "extraInformation": [], "hidden": true, "name": "hasshadow" } ] }, { "description": "", "fullName": "", "name": "XYSort", "objectType": "", "eventsFunctions": [], "propertyDescriptors": [] } ] }