@pixi/particles
Advanced tools
Comparing version 5.1.5 to 5.2.0
/*! | ||
* @pixi/particles - v5.1.5 | ||
* Compiled Tue, 24 Sep 2019 04:07:05 UTC | ||
* @pixi/particles - v5.2.0 | ||
* Compiled Wed, 06 Nov 2019 02:32:43 UTC | ||
* | ||
@@ -661,3 +661,3 @@ * @pixi/particles is licensed under the MIT License. | ||
// if the uvs have not updated then no point rendering just yet! | ||
this.renderer.state.setBlendMode(utils.correctBlendMode(container.blendMode, baseTexture.premultiplyAlpha)); | ||
this.renderer.state.setBlendMode(utils.correctBlendMode(container.blendMode, baseTexture.alphaMode)); | ||
@@ -673,3 +673,3 @@ var gl = renderer.gl; | ||
this.shader.uniforms.uColor = utils.premultiplyRgba(container.tintRgb, | ||
container.worldAlpha, this.shader.uniforms.uColor, baseTexture.premultiplyAlpha); | ||
container.worldAlpha, this.shader.uniforms.uColor, baseTexture.alphaMode); | ||
@@ -940,3 +940,3 @@ this.shader.uniforms.uSampler = baseTexture; | ||
var sprite = children[startIndex + i]; | ||
var premultiplied = sprite._texture.baseTexture.premultiplyAlpha; | ||
var premultiplied = sprite._texture.baseTexture.alphaMode > 0; | ||
var alpha = sprite.alpha; | ||
@@ -943,0 +943,0 @@ // we dont call extra function if alpha is 1.0, that's faster |
/*! | ||
* @pixi/particles - v5.1.5 | ||
* Compiled Tue, 24 Sep 2019 04:07:05 UTC | ||
* @pixi/particles - v5.2.0 | ||
* Compiled Wed, 06 Nov 2019 02:32:43 UTC | ||
* | ||
@@ -8,3 +8,3 @@ * @pixi/particles is licensed under the MIT License. | ||
*/ | ||
this.PIXI=this.PIXI||{};var _pixi_particles=function(t,e,i,r,s,o){"use strict";var a=function(t){function r(i,r,s,o){void 0===i&&(i=1500),void 0===s&&(s=16384),void 0===o&&(o=!1),t.call(this);s>16384&&(s=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=i,this._batchSize=s,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=e.BLEND_MODES.NORMAL,this.autoResize=o,this.roundPixels=!0,this.baseTexture=null,this.setProperties(r),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r;var s={tint:{configurable:!0}};return r.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},r.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},s.tint.get=function(){return this._tint},s.tint.set=function(t){this._tint=t,i.hex2rgb(t,this.tintRgb)},r.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},r.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.length<e;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[e]=++this._updateID},r.prototype.dispose=function(){if(this._buffers){for(var t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}},r.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null},Object.defineProperties(r.prototype,s),r}(r.Container),n=function(t,i,r){this.geometry=new s.Geometry,this.indexBuffer=null,this.size=r,this.dynamicProperties=[],this.staticProperties=[];for(var o=0;o<t.length;++o){var a=t[o];a={attributeName:a.attributeName,size:a.size,uploadFunction:a.uploadFunction,type:a.type||e.TYPES.FLOAT,offset:a.offset},i[o]?this.dynamicProperties.push(a):this.staticProperties.push(a)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()};n.prototype.initBuffers=function(){var t=this.geometry,r=0;this.indexBuffer=new s.Buffer(i.createIndicesForQuads(this.size),!0,!0),t.addIndex(this.indexBuffer),this.dynamicStride=0;for(var o=0;o<this.dynamicProperties.length;++o){var a=this.dynamicProperties[o];a.offset=r,r+=a.size,this.dynamicStride+=a.size}var n=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(n),this.dynamicDataUint32=new Uint32Array(n),this.dynamicBuffer=new s.Buffer(this.dynamicData,!1,!1);var h=0;this.staticStride=0;for(var u=0;u<this.staticProperties.length;++u){var p=this.staticProperties[u];p.offset=h,h+=p.size,this.staticStride+=p.size}var l=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(l),this.staticDataUint32=new Uint32Array(l),this.staticBuffer=new s.Buffer(this.staticData,!0,!1);for(var c=0;c<this.dynamicProperties.length;++c){var d=this.dynamicProperties[c];t.addAttribute(d.attributeName,this.dynamicBuffer,0,d.type===e.TYPES.UNSIGNED_BYTE,d.type,4*this.dynamicStride,4*d.offset)}for(var f=0;f<this.staticProperties.length;++f){var y=this.staticProperties[f];t.addAttribute(y.attributeName,this.staticBuffer,0,y.type===e.TYPES.UNSIGNED_BYTE,y.type,4*this.staticStride,4*y.offset)}},n.prototype.uploadDynamic=function(t,i,r){for(var s=0;s<this.dynamicProperties.length;s++){var o=this.dynamicProperties[s];o.uploadFunction(t,i,r,o.type===e.TYPES.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,o.offset)}this.dynamicBuffer._updateID++},n.prototype.uploadStatic=function(t,i,r){for(var s=0;s<this.staticProperties.length;s++){var o=this.staticProperties[s];o.uploadFunction(t,i,r,o.type===e.TYPES.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,o.offset)}this.staticBuffer._updateID++},n.prototype.destroy=function(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()};var h="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nattribute vec2 aPositionCoord;\nattribute float aRotation;\n\nuniform mat3 translationMatrix;\nuniform vec4 uColor;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void){\n float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\n float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\n\n vec2 v = vec2(x, y);\n v = v + aPositionCoord;\n\n gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vColor = aColor * uColor;\n}\n",u="varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\n gl_FragColor = color;\n}",p=function(t){function r(i){t.call(this,i),this.shader=null,this.properties=null,this.tempMatrix=new o.Matrix,this.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:this.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:this.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:this.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:this.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:e.TYPES.UNSIGNED_BYTE,uploadFunction:this.uploadTint,offset:0}],this.shader=s.Shader.from(h,u,{})}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.render=function(t){var e=t.children,r=t._maxSize,s=t._batchSize,o=this.renderer,a=e.length;if(0!==a){a>r&&!t.autoResize&&(a=r);var n=t._buffers;n||(n=t._buffers=this.generateBuffers(t));var h=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(i.correctBlendMode(t.blendMode,h.premultiplyAlpha));var u=o.gl,p=t.worldTransform.copyTo(this.tempMatrix);p.prepend(o.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=p.toArray(!0),this.shader.uniforms.uColor=i.premultiplyRgba(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,h.premultiplyAlpha),this.shader.uniforms.uSampler=h,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;c<a;c+=s,d+=1){var f=a-c;f>s&&(f=s),d>=n.length&&n.push(this._generateOneMoreBuffer(t));var y=n[d];y.uploadDynamic(e,c,f);var v=t._bufferUpdateIDs[d]||0;(l=l||y._updateID<v)&&(y._updateID=t._updateID,y.uploadStatic(e,c,f)),o.geometry.bind(y.geometry),u.drawElements(u.TRIANGLES,6*f,u.UNSIGNED_SHORT,0)}}},r.prototype.generateBuffers=function(t){for(var e=[],i=t._maxSize,r=t._batchSize,s=t._properties,o=0;o<i;o+=r)e.push(new n(this.properties,s,r));return e},r.prototype._generateOneMoreBuffer=function(t){var e=t._batchSize,i=t._properties;return new n(this.properties,i,e)},r.prototype.uploadVertices=function(t,e,i,r,s,o){for(var a=0,n=0,h=0,u=0,p=0;p<i;++p){var l=t[e+p],c=l._texture,d=l.scale.x,f=l.scale.y,y=c.trim,v=c.orig;y?(a=(n=y.x-l.anchor.x*v.width)+y.width,h=(u=y.y-l.anchor.y*v.height)+y.height):(a=v.width*(1-l.anchor.x),n=v.width*-l.anchor.x,h=v.height*(1-l.anchor.y),u=v.height*-l.anchor.y),r[o]=n*d,r[o+1]=u*f,r[o+s]=a*d,r[o+s+1]=u*f,r[o+2*s]=a*d,r[o+2*s+1]=h*f,r[o+3*s]=n*d,r[o+3*s+1]=h*f,o+=4*s}},r.prototype.uploadPosition=function(t,e,i,r,s,o){for(var a=0;a<i;a++){var n=t[e+a].position;r[o]=n.x,r[o+1]=n.y,r[o+s]=n.x,r[o+s+1]=n.y,r[o+2*s]=n.x,r[o+2*s+1]=n.y,r[o+3*s]=n.x,r[o+3*s+1]=n.y,o+=4*s}},r.prototype.uploadRotation=function(t,e,i,r,s,o){for(var a=0;a<i;a++){var n=t[e+a].rotation;r[o]=n,r[o+s]=n,r[o+2*s]=n,r[o+3*s]=n,o+=4*s}},r.prototype.uploadUvs=function(t,e,i,r,s,o){for(var a=0;a<i;++a){var n=t[e+a]._texture._uvs;n?(r[o]=n.x0,r[o+1]=n.y0,r[o+s]=n.x1,r[o+s+1]=n.y1,r[o+2*s]=n.x2,r[o+2*s+1]=n.y2,r[o+3*s]=n.x3,r[o+3*s+1]=n.y3,o+=4*s):(r[o]=0,r[o+1]=0,r[o+s]=0,r[o+s+1]=0,r[o+2*s]=0,r[o+2*s+1]=0,r[o+3*s]=0,r[o+3*s+1]=0,o+=4*s)}},r.prototype.uploadTint=function(t,e,r,s,o,a){for(var n=0;n<r;++n){var h=t[e+n],u=h._texture.baseTexture.premultiplyAlpha,p=h.alpha,l=p<1&&u?i.premultiplyTint(h._tintRGB,p):h._tintRGB+(255*p<<24);s[a]=l,s[a+o]=l,s[a+2*o]=l,s[a+3*o]=l,a+=4*o}},r.prototype.destroy=function(){t.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},r}(s.ObjectRenderer);return t.ParticleContainer=a,t.ParticleRenderer=p,t}({},PIXI,PIXI.utils,PIXI,PIXI,PIXI);Object.assign(this.PIXI,_pixi_particles); | ||
this.PIXI=this.PIXI||{};var _pixi_particles=function(t,e,i,r,s,o){"use strict";var a=function(t){function r(i,r,s,o){void 0===i&&(i=1500),void 0===s&&(s=16384),void 0===o&&(o=!1),t.call(this);s>16384&&(s=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=i,this._batchSize=s,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=e.BLEND_MODES.NORMAL,this.autoResize=o,this.roundPixels=!0,this.baseTexture=null,this.setProperties(r),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r;var s={tint:{configurable:!0}};return r.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},r.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},s.tint.get=function(){return this._tint},s.tint.set=function(t){this._tint=t,i.hex2rgb(t,this.tintRgb)},r.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},r.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.length<e;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[e]=++this._updateID},r.prototype.dispose=function(){if(this._buffers){for(var t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}},r.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null},Object.defineProperties(r.prototype,s),r}(r.Container),n=function(t,i,r){this.geometry=new s.Geometry,this.indexBuffer=null,this.size=r,this.dynamicProperties=[],this.staticProperties=[];for(var o=0;o<t.length;++o){var a=t[o];a={attributeName:a.attributeName,size:a.size,uploadFunction:a.uploadFunction,type:a.type||e.TYPES.FLOAT,offset:a.offset},i[o]?this.dynamicProperties.push(a):this.staticProperties.push(a)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()};n.prototype.initBuffers=function(){var t=this.geometry,r=0;this.indexBuffer=new s.Buffer(i.createIndicesForQuads(this.size),!0,!0),t.addIndex(this.indexBuffer),this.dynamicStride=0;for(var o=0;o<this.dynamicProperties.length;++o){var a=this.dynamicProperties[o];a.offset=r,r+=a.size,this.dynamicStride+=a.size}var n=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(n),this.dynamicDataUint32=new Uint32Array(n),this.dynamicBuffer=new s.Buffer(this.dynamicData,!1,!1);var h=0;this.staticStride=0;for(var u=0;u<this.staticProperties.length;++u){var p=this.staticProperties[u];p.offset=h,h+=p.size,this.staticStride+=p.size}var d=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(d),this.staticDataUint32=new Uint32Array(d),this.staticBuffer=new s.Buffer(this.staticData,!0,!1);for(var c=0;c<this.dynamicProperties.length;++c){var l=this.dynamicProperties[c];t.addAttribute(l.attributeName,this.dynamicBuffer,0,l.type===e.TYPES.UNSIGNED_BYTE,l.type,4*this.dynamicStride,4*l.offset)}for(var f=0;f<this.staticProperties.length;++f){var y=this.staticProperties[f];t.addAttribute(y.attributeName,this.staticBuffer,0,y.type===e.TYPES.UNSIGNED_BYTE,y.type,4*this.staticStride,4*y.offset)}},n.prototype.uploadDynamic=function(t,i,r){for(var s=0;s<this.dynamicProperties.length;s++){var o=this.dynamicProperties[s];o.uploadFunction(t,i,r,o.type===e.TYPES.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,o.offset)}this.dynamicBuffer._updateID++},n.prototype.uploadStatic=function(t,i,r){for(var s=0;s<this.staticProperties.length;s++){var o=this.staticProperties[s];o.uploadFunction(t,i,r,o.type===e.TYPES.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,o.offset)}this.staticBuffer._updateID++},n.prototype.destroy=function(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()};var h="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nattribute vec2 aPositionCoord;\nattribute float aRotation;\n\nuniform mat3 translationMatrix;\nuniform vec4 uColor;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void){\n float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\n float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\n\n vec2 v = vec2(x, y);\n v = v + aPositionCoord;\n\n gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vColor = aColor * uColor;\n}\n",u="varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\n gl_FragColor = color;\n}",p=function(t){function r(i){t.call(this,i),this.shader=null,this.properties=null,this.tempMatrix=new o.Matrix,this.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:this.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:this.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:this.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:this.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:e.TYPES.UNSIGNED_BYTE,uploadFunction:this.uploadTint,offset:0}],this.shader=s.Shader.from(h,u,{})}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.render=function(t){var e=t.children,r=t._maxSize,s=t._batchSize,o=this.renderer,a=e.length;if(0!==a){a>r&&!t.autoResize&&(a=r);var n=t._buffers;n||(n=t._buffers=this.generateBuffers(t));var h=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(i.correctBlendMode(t.blendMode,h.alphaMode));var u=o.gl,p=t.worldTransform.copyTo(this.tempMatrix);p.prepend(o.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=p.toArray(!0),this.shader.uniforms.uColor=i.premultiplyRgba(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,h.alphaMode),this.shader.uniforms.uSampler=h,this.renderer.shader.bind(this.shader);for(var d=!1,c=0,l=0;c<a;c+=s,l+=1){var f=a-c;f>s&&(f=s),l>=n.length&&n.push(this._generateOneMoreBuffer(t));var y=n[l];y.uploadDynamic(e,c,f);var v=t._bufferUpdateIDs[l]||0;(d=d||y._updateID<v)&&(y._updateID=t._updateID,y.uploadStatic(e,c,f)),o.geometry.bind(y.geometry),u.drawElements(u.TRIANGLES,6*f,u.UNSIGNED_SHORT,0)}}},r.prototype.generateBuffers=function(t){for(var e=[],i=t._maxSize,r=t._batchSize,s=t._properties,o=0;o<i;o+=r)e.push(new n(this.properties,s,r));return e},r.prototype._generateOneMoreBuffer=function(t){var e=t._batchSize,i=t._properties;return new n(this.properties,i,e)},r.prototype.uploadVertices=function(t,e,i,r,s,o){for(var a=0,n=0,h=0,u=0,p=0;p<i;++p){var d=t[e+p],c=d._texture,l=d.scale.x,f=d.scale.y,y=c.trim,v=c.orig;y?(a=(n=y.x-d.anchor.x*v.width)+y.width,h=(u=y.y-d.anchor.y*v.height)+y.height):(a=v.width*(1-d.anchor.x),n=v.width*-d.anchor.x,h=v.height*(1-d.anchor.y),u=v.height*-d.anchor.y),r[o]=n*l,r[o+1]=u*f,r[o+s]=a*l,r[o+s+1]=u*f,r[o+2*s]=a*l,r[o+2*s+1]=h*f,r[o+3*s]=n*l,r[o+3*s+1]=h*f,o+=4*s}},r.prototype.uploadPosition=function(t,e,i,r,s,o){for(var a=0;a<i;a++){var n=t[e+a].position;r[o]=n.x,r[o+1]=n.y,r[o+s]=n.x,r[o+s+1]=n.y,r[o+2*s]=n.x,r[o+2*s+1]=n.y,r[o+3*s]=n.x,r[o+3*s+1]=n.y,o+=4*s}},r.prototype.uploadRotation=function(t,e,i,r,s,o){for(var a=0;a<i;a++){var n=t[e+a].rotation;r[o]=n,r[o+s]=n,r[o+2*s]=n,r[o+3*s]=n,o+=4*s}},r.prototype.uploadUvs=function(t,e,i,r,s,o){for(var a=0;a<i;++a){var n=t[e+a]._texture._uvs;n?(r[o]=n.x0,r[o+1]=n.y0,r[o+s]=n.x1,r[o+s+1]=n.y1,r[o+2*s]=n.x2,r[o+2*s+1]=n.y2,r[o+3*s]=n.x3,r[o+3*s+1]=n.y3,o+=4*s):(r[o]=0,r[o+1]=0,r[o+s]=0,r[o+s+1]=0,r[o+2*s]=0,r[o+2*s+1]=0,r[o+3*s]=0,r[o+3*s+1]=0,o+=4*s)}},r.prototype.uploadTint=function(t,e,r,s,o,a){for(var n=0;n<r;++n){var h=t[e+n],u=h._texture.baseTexture.alphaMode>0,p=h.alpha,d=p<1&&u?i.premultiplyTint(h._tintRGB,p):h._tintRGB+(255*p<<24);s[a]=d,s[a+o]=d,s[a+2*o]=d,s[a+3*o]=d,a+=4*o}},r.prototype.destroy=function(){t.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},r}(s.ObjectRenderer);return t.ParticleContainer=a,t.ParticleRenderer=p,t}({},PIXI,PIXI.utils,PIXI,PIXI,PIXI);Object.assign(this.PIXI,_pixi_particles); | ||
//# sourceMappingURL=particles.min.js.map |
/*! | ||
* @pixi/particles - v5.1.5 | ||
* Compiled Tue, 24 Sep 2019 04:07:05 UTC | ||
* @pixi/particles - v5.2.0 | ||
* Compiled Wed, 06 Nov 2019 02:32:43 UTC | ||
* | ||
@@ -663,3 +663,3 @@ * @pixi/particles is licensed under the MIT License. | ||
// if the uvs have not updated then no point rendering just yet! | ||
this.renderer.state.setBlendMode(correctBlendMode(container.blendMode, baseTexture.premultiplyAlpha)); | ||
this.renderer.state.setBlendMode(correctBlendMode(container.blendMode, baseTexture.alphaMode)); | ||
@@ -675,3 +675,3 @@ var gl = renderer.gl; | ||
this.shader.uniforms.uColor = premultiplyRgba(container.tintRgb, | ||
container.worldAlpha, this.shader.uniforms.uColor, baseTexture.premultiplyAlpha); | ||
container.worldAlpha, this.shader.uniforms.uColor, baseTexture.alphaMode); | ||
@@ -942,3 +942,3 @@ this.shader.uniforms.uSampler = baseTexture; | ||
var sprite = children[startIndex + i]; | ||
var premultiplied = sprite._texture.baseTexture.premultiplyAlpha; | ||
var premultiplied = sprite._texture.baseTexture.alphaMode > 0; | ||
var alpha = sprite.alpha; | ||
@@ -945,0 +945,0 @@ // we dont call extra function if alpha is 1.0, that's faster |
/*! | ||
* @pixi/particles - v5.1.5 | ||
* Compiled Tue, 24 Sep 2019 04:07:05 UTC | ||
* @pixi/particles - v5.2.0 | ||
* Compiled Wed, 06 Nov 2019 02:32:43 UTC | ||
* | ||
@@ -667,3 +667,3 @@ * @pixi/particles is licensed under the MIT License. | ||
// if the uvs have not updated then no point rendering just yet! | ||
this.renderer.state.setBlendMode(utils.correctBlendMode(container.blendMode, baseTexture.premultiplyAlpha)); | ||
this.renderer.state.setBlendMode(utils.correctBlendMode(container.blendMode, baseTexture.alphaMode)); | ||
@@ -679,3 +679,3 @@ var gl = renderer.gl; | ||
this.shader.uniforms.uColor = utils.premultiplyRgba(container.tintRgb, | ||
container.worldAlpha, this.shader.uniforms.uColor, baseTexture.premultiplyAlpha); | ||
container.worldAlpha, this.shader.uniforms.uColor, baseTexture.alphaMode); | ||
@@ -946,3 +946,3 @@ this.shader.uniforms.uSampler = baseTexture; | ||
var sprite = children[startIndex + i]; | ||
var premultiplied = sprite._texture.baseTexture.premultiplyAlpha; | ||
var premultiplied = sprite._texture.baseTexture.alphaMode > 0; | ||
var alpha = sprite.alpha; | ||
@@ -949,0 +949,0 @@ // we dont call extra function if alpha is 1.0, that's faster |
{ | ||
"name": "@pixi/particles", | ||
"version": "5.1.5", | ||
"version": "5.2.0", | ||
"main": "lib/particles.js", | ||
@@ -27,9 +27,9 @@ "module": "lib/particles.es.js", | ||
"dependencies": { | ||
"@pixi/constants": "^5.1.0", | ||
"@pixi/core": "^5.1.5", | ||
"@pixi/display": "^5.1.3", | ||
"@pixi/math": "^5.1.0", | ||
"@pixi/utils": "^5.1.3" | ||
"@pixi/constants": "^5.2.0", | ||
"@pixi/core": "^5.2.0", | ||
"@pixi/display": "^5.2.0", | ||
"@pixi/math": "^5.2.0", | ||
"@pixi/utils": "^5.2.0" | ||
}, | ||
"gitHead": "8cf3db88d06355cbabea64150cdb0774191e502c" | ||
"gitHead": "aaf96b460582b83a1fa73037ef2dd69dd9e84415" | ||
} |
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
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
303241
Updated@pixi/constants@^5.2.0
Updated@pixi/core@^5.2.0
Updated@pixi/display@^5.2.0
Updated@pixi/math@^5.2.0
Updated@pixi/utils@^5.2.0