Archived

This topic is now archived and is closed to further replies.

dragon376

Transparency to make trees

Recommended Posts

I have a small problem of transparancy... My tree is not alwars transparent. look at this picture (http://www.kuenzle-family.ch/philippe/gl/transproblem.jpg). You can see that an area around the tree over the water. If anyone has a idea what I am doing wrong let me know... (philippe@insync.net) Thanks

Share this post


Link to post
Share on other sites
Hey Philippe, what''s new?
I mailed you 2 months ago, I''m still waiting for an answer....

Well, I wanna try to help you, which kind of problem is it exactly?
I solve a problem about transparency some months ago.

Bye

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
this is what i did when i wanted transparency, may not be the best way but i''ll post it anyway.

glEnable(GL_BLEND);
glEnable(GL_DEPTH_TEST);

Depending upon where the code is placed blending may have to be disabled, so order matters when you use those.

Share this post


Link to post
Share on other sites
the problem is u have disabled depth writes when u drew the water.
well u can sort the polygons (under water frist , then water , then above water) or else in this case dont use blending for the trees use the alpha test.
glEnable( GL_ALPHA_TEST)
glAlphaTEst( GL_NOTEQUAL,0);
glDisable( GL_BLEND)
draw trees

Share this post


Link to post
Share on other sites