Archived

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

0DeRiveD0

masking help

Recommended Posts

i have a cylinder with a rod sticking out of it. the cylinder has a texture on it with a logo and the logo is masked by drawing another cylinder with a mask behind it therefore making the cylinder transparent and the logo not. the problem: i draw the rod first and then the texture mapped cylinder, but it always appears that the rod it behind the cylinder no matter how close i bring the rod on the z-axis. how do i make the rod look like its inside of the cylinder? thx in advance -jc

Share this post


Link to post
Share on other sites
Since nobody else has answered your question, I''ll give it a try...

Sounds like the depth test is turned off. If you don''t want to turn it on for the cylinder, try drawing the cylinder first, then turn on the depth test and finally draw the rod.

Another option is to use an RGBA image for the logo and the glAlphaTest() function, and have the depth test turned on while drawing both objects in any order.

Haven''t played around much with this myself, so anybody, correct me if I''m wrong.

Share this post


Link to post
Share on other sites
Alpha testing would be the best way yes. And you don''t need masking anymore.

There seem to be a *lot* of masking/alpha testing questions on the forum lately. Maybe it''s time someone wrote a tutorial on alpha testing. Maybe I will if I have some spare time

- An eye for an eye will make the world go blind -

Share this post


Link to post
Share on other sites