Archived

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

Problems with masking.

This topic is 5538 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have gone through NeHe OpenGL tutorial 20, regarding masking. Turning off depth testing gives the right effect but means that the object can be viewed through ALL walls that have been drawn before it. Is there any way to avoid this other than stategic planning of when everything gets draw? I''ve also heard of using a 32-bit image with an alpha channel. Would this eliminate the need to turn off depth testing? Also, still concerning the above problem, I am having trouble drawing trees and shrubs using a common technique I have seen in many videogames. When the texture is crossed over the centre of itself on a perpendicular angle, giving a "cross shape" viewed from above. The problem is in the ordering of when the textures are draw. One must always be drawn before the other, therefore creating problems with transparency. Would the ordering have to be calculated "on-the-fly" according to the viewing position of the camera?

Share this post


Link to post
Share on other sites
those crisscrossed trees use alphatesting (which doesnt suffer from sorting problems) not blending + certainly not masking

http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
I was worried about the problem of blending crossed trees a while back and then hit on a simple solution - only draw one texture, making sure it is facing the camera at all times. As a result you don''t need the 3D effect of the crossed textures and you also save the number of polygons you need to draw per tree.

There is a concern that the rotation of the tree texture might be visible as you move around it, but from experience this is not an issue (although I''m not coding an action game).

A few examples of this in operation can be seen at the following URL ... http://www.geocities.com/jonalma/screenshots.html

Hope that helps, Jon.

Share this post


Link to post
Share on other sites