I have two particle systems - blurry blobs and some stars. The blurry blobs are always at 0.1 alpha before fading to 0.0 before expiring. The stars should start at 1.0, before fading to 0.0 at the end before expiring. Like so
Using java Syntax Highlighting
- m_BlurBlobParticleSystem = new SpriteParticleSystem(new PointParticleEmitter(176.0f, 336.0f), 1, 3, 15, m_BlurBlobTextureRegion, this.getVertexBufferObjectManager());
- m_BlurBlobParticleSystem.addParticleInitializer(new BlendFunctionParticleInitializer<Sprite>(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE));
- m_BlurBlobParticleSystem.addParticleInitializer(new AlphaParticleInitializer<Sprite>(0.1f));
- m_BlurBlobParticleSystem.addParticleModifier( new AlphaParticleModifier<Sprite>(4.5f, 5.0f, 0.1f, 0.0f) );
- m_BlurBlobParticleSystem.addParticleModifier(new ExpireParticleModifier<Sprite>(5.0f));
- m_BlurBlobParticleSystem.addParticleInitializer( new VelocityParticleInitializer<Sprite>( -150.0f, 150.0f, -150.0f, 150.0f));
- m_StarParticleSystem = new SpriteParticleSystem(new PointParticleEmitter(176.0f, 336.0f), 3, 10, 50, m_StarTextureRegion, this.getVertexBufferObjectManager());
- m_StarParticleSystem.addParticleInitializer(new BlendFunctionParticleInitializer<Sprite>(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE));
- m_StarParticleSystem.addParticleInitializer(new AlphaParticleInitializer<Sprite>(1.0f));
- m_StarParticleSystem.addParticleModifier( new AlphaParticleModifier<Sprite>(4.5f, 5.0f, 1.0f, 0.0f) );
- m_StarParticleSystem.addParticleModifier(new ExpireParticleModifier<Sprite>(5.0f));
- m_StarParticleSystem.addParticleInitializer( new VelocityParticleInitializer<Sprite>( -150.0f, 150.0f, -150.0f, 150.0f));
- m_Scene.attachChild( m_BlurBlobParticleSystem );
- m_Scene.attachChild( m_StarParticleSystem );
Parsed in 0.035 seconds, using GeSHi 1.0.8.4
The bug was found with the star particle system. After a while (I believe once it starts reusing particles to spawn new ones), the star particles are not getting set to 1.0 alpha when they spawn regardless of the alpha initializer on them. They then seem to remain near or at zero alpha from the previous particles setting before it was respawned. If I change the initializer to 0.9 alpha, then it works fine. It's only 1.0 that it can't set them too.
It looks like an alpha issue was addressed in the codebase about 5 days ago, but it appears this still remains.
Cheers
