Order independent blending?

Started by Andrew_3ds, February 10, 2015, 04:34:32

Previous topic - Next topic

Andrew_3ds

The transparency in my game works partially, but if a transparent sprite goes behind another transparent sprite that is being drawn second, it will overlap the other one even though it is transparent.
Here is an example:


I am using glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) for my blending mode. Is there a way to fix this easily?

Cornix

You have to sort transparent sprites by their distance to the camera.