diff --git a/assets/shaders/OutlineFragment.glsl b/assets/shaders/OutlineFragment.glsl index 9f48f1a7..7ddcebdb 100644 --- a/assets/shaders/OutlineFragment.glsl +++ b/assets/shaders/OutlineFragment.glsl @@ -10,8 +10,8 @@ varying vec2 v_texCoords; // From VS uniform sampler2D u_texture; // From TCPB uniform vec3 u_outlineColor; // Required uniform float u_outlineWidth; // Required -uniform ivec2 u_textureSize; -uniform float u_alpha; +uniform ivec2 u_textureSize; // Required +uniform float u_alpha; // Required const float c_alphaLv0 = 0.1; const float c_alphaLv1 = 0.5; @@ -78,6 +78,7 @@ void main() { // No effect apply on other areas gl_FragColor = texColor; } - // Alpha - gl_FragColor.a -= (1 - u_alpha); + + // Ultimate alpha control + gl_FragColor.a *= u_alpha; } diff --git a/core/src/cn/harryh/arkpets/ArkChar.java b/core/src/cn/harryh/arkpets/ArkChar.java index 83ef944f..ccba5d77 100644 --- a/core/src/cn/harryh/arkpets/ArkChar.java +++ b/core/src/cn/harryh/arkpets/ArkChar.java @@ -227,7 +227,6 @@ protected void renderToBatch() { batch.setShader(shader1); ScreenUtils.clear(0, 0, 0, 0, true); batch.begin(); - batch.draw(bgTexture, 0, 0); renderer.draw(batch, skeleton); batch.end(); batch.setShader(null); @@ -242,6 +241,7 @@ protected void renderToBatch() { batch.setShader(shader2); ScreenUtils.clear(0, 0, 0, 0, true); batch.begin(); + batch.draw(bgTexture, 0, 0); batch.draw(passedTexture, 0, 0, 0, 0, camera.getWidth(), camera.getHeight(), 1, 1, 0,