diff --git a/src/particles/ParticleContainer.js b/src/particles/ParticleContainer.js index 16ddb7a..5827c3b 100644 --- a/src/particles/ParticleContainer.js +++ b/src/particles/ParticleContainer.js @@ -32,7 +32,8 @@ * @param {number} [maxSize=1500] - The maximum number of particles that can be rendered by the container. * Affects size of allocated buffers. * @param {object} [properties] - The properties of children that should be uploaded to the gpu and applied. - * @param {boolean} [properties.scale=false] - When true, scale be uploaded and applied. + * @param {boolean} [properties.vertices=false] - When true, vertices be uploaded and applied. + * if sprite's ` scale/anchor/trim/frame/orig` is dynamic, please set `true`. * @param {boolean} [properties.position=true] - When true, position be uploaded and applied. * @param {boolean} [properties.rotation=false] - When true, rotation be uploaded and applied. * @param {boolean} [properties.uvs=false] - When true, uvs be uploaded and applied. @@ -156,12 +157,13 @@ { if (properties) { - this._properties[0] = 'scale' in properties ? !!properties.scale : this._properties[0]; + this._properties[0] = 'vertices' in properties || 'scale' in properties + ? !!properties.vertices || !!properties.scale : this._properties[0]; this._properties[1] = 'position' in properties ? !!properties.position : this._properties[1]; this._properties[2] = 'rotation' in properties ? !!properties.rotation : this._properties[2]; this._properties[3] = 'uvs' in properties ? !!properties.uvs : this._properties[3]; - this._properties[4] = 'alpha' in properties || 'tint' in properties - ? !!properties.alpha || !!properties.tint : this._properties[4]; + this._properties[4] = 'tint' in properties || 'alpha' in properties + ? !!properties.tint || !!properties.alpha : this._properties[4]; } } diff --git a/src/particles/ParticleContainer.js b/src/particles/ParticleContainer.js index 16ddb7a..5827c3b 100644 --- a/src/particles/ParticleContainer.js +++ b/src/particles/ParticleContainer.js @@ -32,7 +32,8 @@ * @param {number} [maxSize=1500] - The maximum number of particles that can be rendered by the container. * Affects size of allocated buffers. * @param {object} [properties] - The properties of children that should be uploaded to the gpu and applied. - * @param {boolean} [properties.scale=false] - When true, scale be uploaded and applied. + * @param {boolean} [properties.vertices=false] - When true, vertices be uploaded and applied. + * if sprite's ` scale/anchor/trim/frame/orig` is dynamic, please set `true`. * @param {boolean} [properties.position=true] - When true, position be uploaded and applied. * @param {boolean} [properties.rotation=false] - When true, rotation be uploaded and applied. * @param {boolean} [properties.uvs=false] - When true, uvs be uploaded and applied. @@ -156,12 +157,13 @@ { if (properties) { - this._properties[0] = 'scale' in properties ? !!properties.scale : this._properties[0]; + this._properties[0] = 'vertices' in properties || 'scale' in properties + ? !!properties.vertices || !!properties.scale : this._properties[0]; this._properties[1] = 'position' in properties ? !!properties.position : this._properties[1]; this._properties[2] = 'rotation' in properties ? !!properties.rotation : this._properties[2]; this._properties[3] = 'uvs' in properties ? !!properties.uvs : this._properties[3]; - this._properties[4] = 'alpha' in properties || 'tint' in properties - ? !!properties.alpha || !!properties.tint : this._properties[4]; + this._properties[4] = 'tint' in properties || 'alpha' in properties + ? !!properties.tint || !!properties.alpha : this._properties[4]; } } diff --git a/src/particles/webgl/ParticleShader.js b/src/particles/webgl/ParticleShader.js index d536190..17d5f03 100644 --- a/src/particles/webgl/ParticleShader.js +++ b/src/particles/webgl/ParticleShader.js @@ -21,7 +21,6 @@ 'attribute vec4 aColor;', 'attribute vec2 aPositionCoord;', - 'attribute vec2 aScale;', 'attribute float aRotation;', 'uniform mat3 projectionMatrix;',