Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pixi/filter-simple-lightmap

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/filter-simple-lightmap - npm Package Compare versions

Comparing version 3.1.1 to 4.0.0

dist/filter-simple-lightmap.cjs.js

6

dist/filter-simple-lightmap.js
/*!
* @pixi/filter-simple-lightmap - v3.1.0
* Compiled Wed, 11 Mar 2020 20:38:18 UTC
* @pixi/filter-simple-lightmap - v4.0.0
* Compiled Wed, 03 Mar 2021 00:14:06 UTC
*

@@ -8,3 +8,3 @@ * @pixi/filter-simple-lightmap is licensed under the MIT License.

*/
var __filters=function(t,r,e){"use strict";var o="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}",i="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",n=function(t){function r(r,e,n){void 0===e&&(e=0),void 0===n&&(n=1),t.call(this,o,i),this.uniforms.dimensions=new Float32Array(2),this.uniforms.ambientColor=new Float32Array([0,0,0,n]),this.texture=r,this.color=e}t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r;var n={texture:{configurable:!0},color:{configurable:!0},alpha:{configurable:!0}};return r.prototype.apply=function(t,r,e,o){this.uniforms.dimensions[0]=r.filterFrame.width,this.uniforms.dimensions[1]=r.filterFrame.height,t.applyFilter(this,r,e,o)},n.texture.get=function(){return this.uniforms.uLightmap},n.texture.set=function(t){this.uniforms.uLightmap=t},n.color.set=function(t){var r=this.uniforms.ambientColor;"number"==typeof t?(e.hex2rgb(t,r),this._color=t):(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],this._color=e.rgb2hex(r))},n.color.get=function(){return this._color},n.alpha.get=function(){return this.uniforms.ambientColor[3]},n.alpha.set=function(t){this.uniforms.ambientColor[3]=t},Object.defineProperties(r.prototype,n),r}(r.Filter);return t.SimpleLightmapFilter=n,t}({},PIXI,PIXI.utils);Object.assign(PIXI.filters,__filters);
var __filters=function(e,t,r){"use strict";var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};Object.create;Object.create;var n=function(e){function t(t,r,o){void 0===r&&(r=0),void 0===o&&(o=1);var n=e.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}","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 n._color=0,n.uniforms.dimensions=new Float32Array(2),n.uniforms.ambientColor=new Float32Array([0,0,0,o]),n.texture=t,n.color=r,n}return function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t.prototype.apply=function(e,t,r,o){var n,i;this.uniforms.dimensions[0]=null===(n=t.filterFrame)||void 0===n?void 0:n.width,this.uniforms.dimensions[1]=null===(i=t.filterFrame)||void 0===i?void 0:i.height,e.applyFilter(this,t,r,o)},Object.defineProperty(t.prototype,"texture",{get:function(){return this.uniforms.uLightmap},set:function(e){this.uniforms.uLightmap=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this._color},set:function(e){var t=this.uniforms.ambientColor;"number"==typeof e?(r.hex2rgb(e,t),this._color=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],this._color=r.rgb2hex(t))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.uniforms.ambientColor[3]},set:function(e){this.uniforms.ambientColor[3]=e},enumerable:!1,configurable:!0}),t}(t.Filter);return e.SimpleLightmapFilter=n,Object.defineProperty(e,"__esModule",{value:!0}),e}({},PIXI,PIXI.utils);Object.assign(PIXI.filters,__filters);
//# sourceMappingURL=filter-simple-lightmap.js.map
{
"name": "@pixi/filter-simple-lightmap",
"version": "3.1.1",
"main": "lib/filter-simple-lightmap.cjs.js",
"version": "4.0.0",
"main": "dist/filter-simple-lightmap.cjs.js",
"bundle": "dist/filter-simple-lightmap.js",

@@ -11,4 +11,4 @@ "description": "PixiJS filter to create a light-map from a texture",

],
"module": "lib/filter-simple-lightmap.esm.js",
"types": "types.d.ts",
"module": "dist/filter-simple-lightmap.esm.js",
"types": "index.d.ts",
"homepage": "http://pixijs.com/",

@@ -25,14 +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/utils": "^5.0.0"
"@pixi/constants": "^6.0.0",
"@pixi/core": "^6.0.0",
"@pixi/utils": "^6.0.0"
},
"devDependencies": {
"@tools/fragments": "^3.0.3"
"@pixi/constants": "^6.0.0",
"@pixi/core": "^6.0.0",
"@pixi/utils": "^6.0.0",
"@tools/fragments": "4.0.0"
},
"gitHead": "37397e5039c4ac4690ab64a4e64dd7eda8fc1f75"
"gitHead": "87aeb2c547d853ec3ffa0754bbff0d89a1c4d0cf"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc