@pixi/filter-motion-blur
Advanced tools
Comparing version 3.0.3 to 3.1.0
/*! | ||
* @pixi/filter-motion-blur - v3.0.3 | ||
* Compiled Wed, 29 May 2019 03:04:05 UTC | ||
* @pixi/filter-motion-blur - v3.1.0 | ||
* Compiled Tue, 03 Mar 2020 12:42:37 UTC | ||
* | ||
@@ -8,3 +8,3 @@ * @pixi/filter-motion-blur is licensed under the MIT License. | ||
*/ | ||
var __filters=function(e,t,i){"use strict";var n="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}",o="varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform vec2 uVelocity;\nuniform int uKernelSize;\nuniform float uOffset;\n\nconst int MAX_KERNEL_SIZE = 2048;\n\n// Notice:\n// the perfect way:\n// int kernelSize = min(uKernelSize, MAX_KERNELSIZE);\n// BUT in real use-case , uKernelSize < MAX_KERNELSIZE almost always.\n// So use uKernelSize directly.\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 vec2 velocity = uVelocity / filterArea.xy;\n float offset = -uOffset / length(uVelocity) - 0.5;\n int k = uKernelSize - 1;\n\n for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) {\n if (i == k) {\n break;\n }\n vec2 bias = velocity * (float(i) / float(k) + offset);\n color += texture2D(uSampler, vTextureCoord + bias);\n }\n gl_FragColor = color / float(uKernelSize);\n}\n",r=function(e){function t(t,r,l){void 0===t&&(t=[0,0]),void 0===r&&(r=5),void 0===l&&(l=0),e.call(this,n,o),this.uniforms.uVelocity=new Float32Array(2),this._velocity=new i.ObservablePoint(this.velocityChanged,this),this.velocity=t,this.kernelSize=r,this.offset=l}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={velocity:{configurable:!0},offset:{configurable:!0}};return t.prototype.apply=function(e,t,i,n){var o=this.velocity,r=o.x,l=o.y;this.uniforms.uKernelSize=0!==r||0!==l?this.kernelSize:0,e.applyFilter(this,t,i,n)},r.velocity.set=function(e){Array.isArray(e)?this._velocity.set(e[0],e[1]):(e instanceof i.Point||e instanceof i.ObservablePoint)&&this._velocity.copy(e)},r.velocity.get=function(){return this._velocity},t.prototype.velocityChanged=function(){this.uniforms.uVelocity[0]=this._velocity.x,this.uniforms.uVelocity[1]=this._velocity.y},r.offset.set=function(e){this.uniforms.uOffset=e},r.offset.get=function(){return this.uniforms.uOffset},Object.defineProperties(t.prototype,r),t}(t.Filter);return e.MotionBlurFilter=r,e}({},PIXI,PIXI);Object.assign(PIXI.filters,__filters); | ||
var __filters=function(e,t,i){"use strict";var n="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}",o="varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform vec2 uVelocity;\nuniform int uKernelSize;\nuniform float uOffset;\n\nconst int MAX_KERNEL_SIZE = 2048;\n\n// Notice:\n// the perfect way:\n// int kernelSize = min(uKernelSize, MAX_KERNELSIZE);\n// BUT in real use-case , uKernelSize < MAX_KERNELSIZE almost always.\n// So use uKernelSize directly.\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 vec2 velocity = uVelocity / filterArea.xy;\n float offset = -uOffset / length(uVelocity) - 0.5;\n int k = uKernelSize - 1;\n\n for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) {\n if (i == k) {\n break;\n }\n vec2 bias = velocity * (float(i) / float(k) + offset);\n color += texture2D(uSampler, vTextureCoord + bias);\n }\n gl_FragColor = color / float(uKernelSize);\n}\n",r=function(e){function t(t,r,l){void 0===t&&(t=[0,0]),void 0===r&&(r=5),void 0===l&&(l=0),e.call(this,n,o),this.uniforms.uVelocity=new Float32Array(2),this._velocity=new i.ObservablePoint(this.velocityChanged,this),this.velocity=t,this.kernelSize=r,this.offset=l}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={velocity:{configurable:!0},offset:{configurable:!0}};return t.prototype.apply=function(e,t,i,n){var o=this.velocity,r=o.x,l=o.y;this.uniforms.uKernelSize=0!==r||0!==l?this.kernelSize:0,e.applyFilter(this,t,i,n)},r.velocity.set=function(e){Array.isArray(e)?this._velocity.set(e[0],e[1]):(e instanceof i.Point||e instanceof i.ObservablePoint)&&this._velocity.copyFrom(e)},r.velocity.get=function(){return this._velocity},t.prototype.velocityChanged=function(){this.uniforms.uVelocity[0]=this._velocity.x,this.uniforms.uVelocity[1]=this._velocity.y},r.offset.set=function(e){this.uniforms.uOffset=e},r.offset.get=function(){return this.uniforms.uOffset},Object.defineProperties(t.prototype,r),t}(t.Filter);return e.MotionBlurFilter=r,e}({},PIXI,PIXI);Object.assign(PIXI.filters,__filters); | ||
//# sourceMappingURL=filter-motion-blur.js.map |
/*! | ||
* @pixi/filter-motion-blur - v3.0.3 | ||
* Compiled Wed, 29 May 2019 03:04:05 UTC | ||
* @pixi/filter-motion-blur - v3.1.0 | ||
* Compiled Tue, 03 Mar 2020 12:42:37 UTC | ||
* | ||
@@ -75,3 +75,3 @@ * @pixi/filter-motion-blur is licensed under the MIT License. | ||
* | ||
* @member {PIXI.ObservablePoint} | ||
* @member {PIXI.ObservablePoint|PIXI.Point|number[]} | ||
*/ | ||
@@ -83,3 +83,3 @@ prototypeAccessors.velocity.set = function (value) { | ||
else if (value instanceof math.Point || value instanceof math.ObservablePoint) { | ||
this._velocity.copy(value); | ||
this._velocity.copyFrom(value); | ||
} | ||
@@ -86,0 +86,0 @@ }; |
/*! | ||
* @pixi/filter-motion-blur - v3.0.3 | ||
* Compiled Wed, 29 May 2019 03:04:05 UTC | ||
* @pixi/filter-motion-blur - v3.1.0 | ||
* Compiled Tue, 03 Mar 2020 12:42:37 UTC | ||
* | ||
@@ -71,3 +71,3 @@ * @pixi/filter-motion-blur is licensed under the MIT License. | ||
* | ||
* @member {PIXI.ObservablePoint} | ||
* @member {PIXI.ObservablePoint|PIXI.Point|number[]} | ||
*/ | ||
@@ -79,3 +79,3 @@ prototypeAccessors.velocity.set = function (value) { | ||
else if (value instanceof Point || value instanceof ObservablePoint) { | ||
this._velocity.copy(value); | ||
this._velocity.copyFrom(value); | ||
} | ||
@@ -82,0 +82,0 @@ }; |
{ | ||
"name": "@pixi/filter-motion-blur", | ||
"version": "3.0.3", | ||
"version": "3.1.0", | ||
"main": "lib/filter-motion-blur.cjs.js", | ||
@@ -25,5 +25,5 @@ "bundle": "dist/filter-motion-blur.js", | ||
], | ||
"dependencies": { | ||
"@pixi/core": "^5.0.0-X", | ||
"@pixi/math": "^5.0.0-X" | ||
"peerDependencies": { | ||
"@pixi/core": "^5.0.0", | ||
"@pixi/math": "^5.0.0" | ||
}, | ||
@@ -33,3 +33,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "0483cafcb2d4324a7db147c641d13ffc33ca657a" | ||
"gitHead": "f4fb8729c0c5a7c35dcb60cbe6d096d5d8947c94" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28299
- Removed@pixi/core@^5.0.0-X
- Removed@pixi/math@^5.0.0-X