From 991377e55fed038c91bdfd83abf1c1425aafb8c0 Mon Sep 17 00:00:00 2001 From: Recrown Date: Wed, 19 Jul 2017 23:48:52 -0500 Subject: [PATCH] shader now works and alpha multiplying issue is fixed --- android/assets/particles/standard_thrust.p | 2 +- core/src/zero1hd/polyjet/ui/stages/GamePlayArea.java | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/android/assets/particles/standard_thrust.p b/android/assets/particles/standard_thrust.p index 8e127b5..fcfdb57 100755 --- a/android/assets/particles/standard_thrust.p +++ b/android/assets/particles/standard_thrust.p @@ -147,7 +147,7 @@ timeline5: 1.0 attached: false continuous: true aligned: false -additive: false +additive: true behind: false premultipliedAlpha: false - Image Path - diff --git a/core/src/zero1hd/polyjet/ui/stages/GamePlayArea.java b/core/src/zero1hd/polyjet/ui/stages/GamePlayArea.java index 2310947..b1cdc69 100755 --- a/core/src/zero1hd/polyjet/ui/stages/GamePlayArea.java +++ b/core/src/zero1hd/polyjet/ui/stages/GamePlayArea.java @@ -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();