-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Description
Issue Details
I am facing a follower error at drawing the Stage debug frames after drawing a particle effect with the ParticleEffect class,
Even with resetting all the "typically known" batch GL properties manually after calling the "ParticleEffect.draw" method:
public void draw(final Batch batch, final float parentAlpha) {
int oldSrcFunc = batch.getBlendSrcFunc();
int oldDstFunc = batch.getBlendDstFunc();
Color oldColor = batch.getColor();
ShaderProgram oldShader = batch.getShader();
Effect.draw(batch);
batch.setBlendFunction(oldSrcFunc, oldDstFunc);
batch.setColor(oldColor);
batch.setShader(oldShader);
Gdx.gl.glDisable(GL20.GL_DEPTH_TEST);
Gdx.gl.glDisable(GL20.GL_CULL_FACE);
//batch.draw(Effect.getEmitters().first().getSprites().first(), 0, 0);
}
The following draw of the Stage debug frames has the wrong color. The color is showing white instead of red/green/blue per Actortype, which points to a problem with the transfer of the additve color setup to the Stage debug frame ShapeRenderer.
Calling another "batch.draw" after the "Effect.draw" heals this issue. The internal logic of "batch.draw" seems to reset some unknown GL setting, that the "Effect.draw" changes but not resets.
Reproduction steps/code
Just compile and run this minimal reproduceable example.
ParticleEffectBug.zip
Version of libGDX and/or relevant dependencies
Framework: LibGdx 1.13.5
Affected platforms
Windows