@pixi/filter-bevel
Advanced tools
Comparing version 3.2.1 to 4.0.0
/*! | ||
* @pixi/filter-bevel - v3.1.1 | ||
* Compiled Wed, 30 Dec 2020 18:30:18 UTC | ||
* @pixi/filter-bevel - v4.0.0 | ||
* Compiled Wed, 03 Mar 2021 00:14:06 UTC | ||
* | ||
@@ -8,3 +8,3 @@ * @pixi/filter-bevel is licensed under the MIT License. | ||
*/ | ||
var __filters=function(o,t,r,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}",e="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",a=function(o){function t(t){void 0===t&&(t={}),o.call(this,n,e),this.uniforms.lightColor=new Float32Array(3),this.uniforms.shadowColor=new Float32Array(3),t=Object.assign({rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},t),this.rotation=t.rotation,this.thickness=t.thickness,this.lightColor=t.lightColor,this.lightAlpha=t.lightAlpha,this.shadowColor=t.shadowColor,this.shadowAlpha=t.shadowAlpha,this.padding=1}o&&(t.__proto__=o),t.prototype=Object.create(o&&o.prototype),t.prototype.constructor=t;var a={rotation:{configurable:!0},thickness:{configurable:!0},lightColor:{configurable:!0},lightAlpha:{configurable:!0},shadowColor:{configurable:!0},shadowAlpha:{configurable:!0}};return t.prototype._updateTransform=function(){this.uniforms.transformX=this._thickness*Math.cos(this._angle),this.uniforms.transformY=this._thickness*Math.sin(this._angle)},a.rotation.get=function(){return this._angle/r.DEG_TO_RAD},a.rotation.set=function(o){this._angle=o*r.DEG_TO_RAD,this._updateTransform()},a.thickness.get=function(){return this._thickness},a.thickness.set=function(o){this._thickness=o,this._updateTransform()},a.lightColor.get=function(){return i.rgb2hex(this.uniforms.lightColor)},a.lightColor.set=function(o){i.hex2rgb(o,this.uniforms.lightColor)},a.lightAlpha.get=function(){return this.uniforms.lightAlpha},a.lightAlpha.set=function(o){this.uniforms.lightAlpha=o},a.shadowColor.get=function(){return i.rgb2hex(this.uniforms.shadowColor)},a.shadowColor.set=function(o){i.hex2rgb(o,this.uniforms.shadowColor)},a.shadowAlpha.get=function(){return this.uniforms.shadowAlpha},a.shadowAlpha.set=function(o){this.uniforms.shadowAlpha=o},Object.defineProperties(t.prototype,a),t}(t.Filter);return o.BevelFilter=a,o}({},PIXI,PIXI,PIXI.utils);Object.assign(PIXI.filters,__filters); | ||
var __filters=function(o,t,r,e){"use strict";var n=function(o,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,t){o.__proto__=t}||function(o,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(o[r]=t[r])})(o,t)};Object.create;Object.create;var i=function(o){function t(t){var r=o.call(this,"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}","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 r._thickness=2,r._angle=0,r.uniforms.lightColor=new Float32Array(3),r.uniforms.shadowColor=new Float32Array(3),Object.assign(r,{rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},t),r.padding=1,r}return function(o,t){function r(){this.constructor=o}n(o,t),o.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,o),t.prototype._updateTransform=function(){this.uniforms.transformX=this._thickness*Math.cos(this._angle),this.uniforms.transformY=this._thickness*Math.sin(this._angle)},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._angle/r.DEG_TO_RAD},set:function(o){this._angle=o*r.DEG_TO_RAD,this._updateTransform()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thickness",{get:function(){return this._thickness},set:function(o){this._thickness=o,this._updateTransform()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lightColor",{get:function(){return e.rgb2hex(this.uniforms.lightColor)},set:function(o){e.hex2rgb(o,this.uniforms.lightColor)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lightAlpha",{get:function(){return this.uniforms.lightAlpha},set:function(o){this.uniforms.lightAlpha=o},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowColor",{get:function(){return e.rgb2hex(this.uniforms.shadowColor)},set:function(o){e.hex2rgb(o,this.uniforms.shadowColor)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowAlpha",{get:function(){return this.uniforms.shadowAlpha},set:function(o){this.uniforms.shadowAlpha=o},enumerable:!1,configurable:!0}),t}(t.Filter);return o.BevelFilter=i,Object.defineProperty(o,"__esModule",{value:!0}),o}({},PIXI,PIXI,PIXI.utils);Object.assign(PIXI.filters,__filters); | ||
//# sourceMappingURL=filter-bevel.js.map |
{ | ||
"name": "@pixi/filter-bevel", | ||
"version": "3.2.1", | ||
"main": "lib/filter-bevel.cjs.js", | ||
"version": "4.0.0", | ||
"main": "dist/filter-bevel.cjs.js", | ||
"bundle": "dist/filter-bevel.js", | ||
@@ -11,4 +11,4 @@ "description": "PixiJS filter to apply a bevel effect", | ||
], | ||
"module": "lib/filter-bevel.esm.js", | ||
"types": "types.d.ts", | ||
"module": "dist/filter-bevel.esm.js", | ||
"types": "index.d.ts", | ||
"homepage": "http://pixijs.com/", | ||
@@ -25,15 +25,17 @@ "bugs": "https://github.com/pixijs/pixi-filters/issues", | ||
"files": [ | ||
"lib", | ||
"dist", | ||
"types.d.ts" | ||
"index.d.ts" | ||
], | ||
"peerDependencies": { | ||
"@pixi/core": "^5.0.0", | ||
"@pixi/math": "^5.0.0", | ||
"@pixi/utils": "^5.0.0" | ||
"@pixi/core": "^6.0.0", | ||
"@pixi/math": "^6.0.0", | ||
"@pixi/utils": "^6.0.0" | ||
}, | ||
"devDependencies": { | ||
"@tools/fragments": "^3.0.3" | ||
"@pixi/core": "^6.0.0", | ||
"@pixi/math": "^6.0.0", | ||
"@pixi/utils": "^6.0.0", | ||
"@tools/fragments": "4.0.0" | ||
}, | ||
"gitHead": "1670e3d693f8aa4272cf17cff0cc0e1bfafb27c4" | ||
"gitHead": "87aeb2c547d853ec3ffa0754bbff0d89a1c4d0cf" | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
77992
472
4
1