Archived

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

Order direct3d primitives are drawn

This topic is 5981 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

Hey all. I''m making a terrain engine using triangle strips and a heightmap and what not, and have come across a problem. Say I have an array representing the terrain..somethign like area[50]50] I can set the triangles up and get it to read in the height and all that, but my problem comes when there rendered. The triangles in [0][0] are, of course rendered before [50][50]. Thats where the problem comes in. The ones rendered last can be seen threw the ones rendered first. If I stand on [0][0] I can see threw all the land in an ugly mess to [50][50], but if I stand on [50][50] and look back it looks good. Should there be an algorithm I should pass the triangles threw before rendering them? Sorry if the post makes no sense, I hate asking questions like this because I think I just missed something stupid like a different Render State. Oh yeah, sorry if this was asked before, but the words "Order Direct3d Primitives drawn" and other variations like that are on the forum''s search ignore list.

Share this post


Link to post
Share on other sites
As long as they''re not wireframe triangles, then Z or W buffering will fix this. Set up a depth buffer surface, turn on z-buffering etc.

Not exactly a simple task, because you should really be checking for supported depth buffer formats (see device enumeration in the SDK), or you can just check using DirectX Caps Viewer (a util that comes with the SDK) to see which format(s) your card supports, use one of them and accept that your program might not work on all video cards.

Your call, but once you''ve written good robust enumeration code, you can reuse it for all your projects, and it tells you in the SDK how to do it.

Share this post


Link to post
Share on other sites
hahaha. Ahhh.....after you step away from the computer for a few hours things can become clearer. heheh. It was partly the Zbuffer. I had one set up......just some of the parameters were messed up. I looked at it again and got it working in 5 minutes. heheh. anyways, thanks!



"Insane people are always sure that they are fine. It is only the sane people who are willing to admit that they are crazy."

Share this post


Link to post
Share on other sites