# Rendering a model with transparent or translucent uv map applied doesn't work

Before I try to make anything transparent, the model renders nicely. When I change the uv layout so that one piece of the model will be transparent, it renders horribly. This is the result with a translucent green texture:

I did transparency with OpenGL when I did 2D games and everything worked nicely because of these two lines:

glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);


Now, I fear, this won't be enough, right? Or maybe I should use some other technique?

• Without seeing your code is a little bit hard to figure out the problem. Please add the related code in your question. – dsilva.vinicius Dec 9 '13 at 19:47
• I'm not even sure what code to actually show you. – Kipras Dec 9 '13 at 20:31
• I mean, this is basic model loading from an .obj file. When the uv is fully opaque it renders well (like in the picture but with opaque green on the chest), but when I change that green to transparent or translucent weird things happen. By the way, the little bit of yellow on the cyan legs aren't a bug, they should be there so that's ok. – Kipras Dec 9 '13 at 20:38
• @Kipras This looks like a sorting issue. Ideally you need to draw all polygons in back-to-front order when using translucency. – Nathan Reed Dec 9 '13 at 20:44
• First enable backface culling. That should make it a lot better, but still wrong. Then proceed to solving the sorting issue if you still need to. – msell Dec 10 '13 at 6:31