diff --git a/src/particles/webgl/ParticleBuffer.js b/src/particles/webgl/ParticleBuffer.js index 0d41f66..e118769 100644 --- a/src/particles/webgl/ParticleBuffer.js +++ b/src/particles/webgl/ParticleBuffer.js @@ -259,12 +259,16 @@ destroy() { this.dynamicProperties = null; - this.dynamicData = null; this.dynamicBuffer.destroy(); + this.dynamicBuffer = null; + this.dynamicData = null; + this.dynamicDataUint32 = null; this.staticProperties = null; - this.staticData = null; this.staticBuffer.destroy(); + this.staticBuffer = null; + this.staticData = null; + this.staticDataUint32 = null; } } diff --git a/src/particles/webgl/ParticleBuffer.js b/src/particles/webgl/ParticleBuffer.js index 0d41f66..e118769 100644 --- a/src/particles/webgl/ParticleBuffer.js +++ b/src/particles/webgl/ParticleBuffer.js @@ -259,12 +259,16 @@ destroy() { this.dynamicProperties = null; - this.dynamicData = null; this.dynamicBuffer.destroy(); + this.dynamicBuffer = null; + this.dynamicData = null; + this.dynamicDataUint32 = null; this.staticProperties = null; - this.staticData = null; this.staticBuffer.destroy(); + this.staticBuffer = null; + this.staticData = null; + this.staticDataUint32 = null; } } diff --git a/src/particles/webgl/ParticleShader.js b/src/particles/webgl/ParticleShader.js index b3584fe..d536190 100644 --- a/src/particles/webgl/ParticleShader.js +++ b/src/particles/webgl/ParticleShader.js @@ -31,10 +31,10 @@ 'varying vec4 vColor;', 'void main(void){', - ' vec2 v = aVertexPosition;', + ' float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);', + ' float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);', - ' v.x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);', - ' v.y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);', + ' vec2 v = vec2(x, y);', ' v = v + aPositionCoord;', ' gl_Position = vec4((projectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);', @@ -52,7 +52,6 @@ 'void main(void){', ' vec4 color = texture2D(uSampler, vTextureCoord) * vColor;', - ' if (color.a == 0.0) discard;', ' gl_FragColor = color;', '}', ].join('\n')