[solved] [libgdx] Frame buffer blending oddly

I’m using frame buffers in my game. I have two: one for rendering terrain and sprites and one for purely lighting.

Lighting is okay, but the world buffer has… odd blending. I tried to render two sprites on top of each other, one not being tinted and one being tinted (dirt back, grass with tint). The result is this weird colour mix:

I was looking for something more like this:

I’ve encountered this blending issue before when I was rendering a semi-transparent overlay to imitate fog but that allowed me to see through the entire world (I think it multiplied alpha instead of adding it).

Some of my WorldRenderer code:
http://pastebin.java-gaming.org/692769d8c2e1d

Why not using always?

glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA)

https://msdn.microsoft.com/en-us/library/bb976070.aspx

I can’t believe it was as simple as that. I swear I tried that before but it must’ve been in the wrong place. Also, that documentation is really good!

Thanks!

Glad to help you.

Yep, I found that doc trying to figure out if you intend to use “ONE,ONE” or it was a mistake.