shader now works and alpha multiplying issue is fixed

This commit is contained in:
Harrison Deng 2017-07-19 23:48:52 -05:00
parent 60dacb6d4c
commit 991377e55f
2 changed files with 5 additions and 8 deletions

View File

@ -147,7 +147,7 @@ timeline5: 1.0
attached: false
continuous: true
aligned: false
additive: false
additive: true
behind: false
premultipliedAlpha: false
- Image Path -

View File

@ -131,17 +131,14 @@ public class GamePlayArea extends Stage {
getBatch().setBlendFunction(-1, -1);
Gdx.gl20.glBlendFuncSeparate(GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_ALPHA,GL20.GL_ONE, GL20.GL_DST_ALPHA);
getBatch().setShader(null);
// use -1 to ignore.. somebody should fix this in LibGDX :\
getBatch().setBlendFunction(-1, -1);
// setup our alpha blending to avoid blending twice
Gdx.gl20.glBlendFuncSeparate(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA, GL20.GL_ONE, GL20.GL_ONE);
super.draw();
blurTarget.end(getViewport().getScreenX(), getViewport().getScreenY(), getViewport().getScreenWidth(), getViewport().getScreenHeight());
getBatch().setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
getBatch().setBlendFunction(GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_ALPHA);
getBatch().begin();
// getBatch().setShader(glowShader);
getBatch().setShader(glowShader);
getBatch().draw(fboRegion, 0f, 0f, Polyjet.GAME_AREA_WIDTH, Polyjet.GAME_AREA_HEIGHT);
getBatch().setShader(null);
getBatch().end();