PDA

View Full Version : Alpha rendering problem (2D) - OpenGL ES



Meahn4
05-29-2012, 11:00 AM
Hello,
im using OpenGL ES with an Android Game Engine called libGDX to create a (2D) game, and i hope there is an easy OpenGL solution for my problem.

I read a lot of tutorials for blending, frameBuffer and stuff like that and im getting a hang of it, but I just cant believe my problem is that complicated.
In my tests blending had not the effect i wanted (tried some glBlendFunc combinations) and FrameBuffer/offscreen workarounds in general seem a bit of an overkill for such a "small" problem.

I need to composite an Object with textures that are overlapping (think of a Unit Object with head, body, legs).

Rendering them in general is no Problem, but to render them with alpha (the overlapping parts are shining through).

747748

I tried blending (glBlendFunc()) with many combinations and read tutorials but it doesnt seem to work the way i want it.

Because I have non-transparent objects and others as well it is not a solution to render these first and render the background with alpha over it

Another thought would be an performant small "offscreen" for rendering the textures on it and then finally render this with alpha.

Is there an easy solution for this?

Greetings
Meahn4

ZbuffeR
05-29-2012, 04:20 PM
Be sure your alpha is opaque when you need it opaque.

Then a default blend mode should be perfect such as glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);