Hello!
Have been off this board for quite some time. So I am glad to finally having a reason to come back. Of course it is that I am having a problem I am not able to fix myself.
I am currently developing with LibGDX. It is a 2D-side-scroller. I used black as the clearColor so far but changed it to white for testing purposes. I use background, foreground and decoration layers to draw tiles. Some tiles have transparency via alpha-channel in PNG-format. Now with the black clearColor it worked fine. But when I changed it to white it suddenly looked like this:
http://www.rm2k-tv.de/stuff/alphaProblem.png
So my questions are: As the vertical structures on the sides of the door belong to the deco layer, shouldn’t the background layer, which is drawn before deco layer, give the source color for the blending? Is the clearColor somehow a problem? What could solve the problem?
I have following line in my code:
batch.setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
This is fixed function, does this still affect rendering when using shaders? I found sources which said so.
To make it clear, my rendering routine for the map works this way:
public void draw(SpriteBatch batch, float x, float y){
drawBG(batch, x, y);
drawFG(batch, x, y);
drawDeco(batch, x, y);
}
And drawDeco is where the transparent PNG is in.
Does someone have a clue? Is some information missing to see the problem? I will be glad if you can help me.