Sign in to follow this  
FarFromHomeFish

Large objects on small tiles are getting overdrawn

Recommended Posts

I'm working on a 2d isometric client. I'm using resources from UO right now. Things are going great, except for some minor graphics issues. One of these is that, since the tiles on which the mobiles stand on are so small, and some of the mobiles graphics are so large, large mobiles are sometimes overdrawn by tiles drawn after they are drawn. Example: What would be some possible solutions to this problem? If the map were flat, I could simply draw all of the landscape tiles and then all of the mobile tiles using layers. But the map is pseudo-3D with 256 layers of height - and looping through the draw routine 256 times isn't feasible. =/ One solution which I've seen discussed is a move from a 2D architecture to 3D. Right now, I use 3D acceleration in my engine, but I don't know how to 'build' a 3D world to take advantage of using 3D transformations to eliminate overlap. What are the steps involved in building the world? Once I build it, can I just move the camera, or do I have to move all the vertexes as the viewpoint moves? [Edited by - FarFromHomeFish on May 7, 2007 9:00:24 PM]

Share this post


Link to post
Share on other sites
Could you hilite some of the errors for us? Maybe recreate the problem with simpler graphics?

Share this post


Link to post
Share on other sites
Quote:
If the map were flat, I could simply draw all of the landscape tiles and then all of the mobile tiles using layers. But the map is pseudo-3D with 256 layers of height - and looping through the draw routine 256 times isn't feasible. =/


Use the z value for tiles and objects and enable the depth buffer. The depth buffer will sort the drawing for you. The only change you make to your rendering code is passing one extra value per vertex. For instance, instead of drawing a vertex at x,y draw it at x,y,height. The drawback to this is transparency/alpha channels. In order for those to look right you need to do them in back to front order so that the objects with alpha channels get drawn after the objects they are in front of.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this