Jump to content
  • Advertisement


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


Tiled Quad or 3D Mesh Terrain?

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

My subject is confusing, sorry. Here''s the deal. I''m currently rendering a tile based quad of 100x100, batching out each texture. That''s 60,000 vertices since no shared vertices contain the same texture coord and around 50 drawprimitive calls. But it''s easier for me to build a world this way, the storyline is good so I don''t care about being fancy, and I still get about 90 FPS on my first video card. I threw in my other video card (because it''s better and supports vertex shaders) and my FPS dropped to 10, something I didn''t expect. It turned out that it doesn''t like to do very many draw primitive calls, but it can process more vertices per draw primitive faster than the other one. So now, I''m thinking I should just go ahead and use a 3D Mesh for the landscape, height map it, then texture it. This is a 3rd person view, half-size characters, and no distance rendering (I''m just showing the ground, no sky). If I use a 3D Mesh, is there a way to load it up in sections. Say the player can see the mesh from (-5, -5) to (5, 5) and is at (0, 0) when he starts, so I render (-10, -10) to (10, 10) as a buffer. When the player moves past (5, 5), I render (-5, -5) to (15, 15). Hope that makes sense. Is there an easy way to do that when I have one big mesh? I hope I''m saying this clearly. In other words, can I render part of a mesh if I know four points that make up the area to render? Or is it a better idea to just display the entire mesh each frame? I''m just unfamiliar with what concepts are used and what the best approach is to get the most efficient render. Other related questions, how does LOD work? What''s the step-by-step implementation of that? Do I store LOD for every position in the world, or do I randomly create it as you go? Any and all feedback is much appreciated! Thanks, Chris *Life is like the rock in a sling-shot. Pick a good target, take good aim, and get there as soon as possible!*

Share this post

Link to post
Share on other sites
hi chris,
i dont''t think that its possible (at least it would be very difficult...) to draw a subset of big mesh in this way. i think your first approach is a good starting point. did you ever heard of "quad tree" rendering? the idea behind this is to seperate the terrain recursivly into quads. check this out : http://www.gamedev.net/reference/programming/features/quadtrees/
by the way: try to use indexed vertex drawing(IDirect3DDevice9::DrawIndexedPrimitive), its much faster then the DrawPrimitive call.

hope that helps


Share this post

Link to post
Share on other sites
Yep, I''m familiar with Quadtrees, never implemented them myself though. That makes sense though, thanks for the suggestion. I will check out the website. I guess I could write a piece of software to design the landscape, then create the QuadTree representation from the mesh. Or is there software that will do that for you that you know of? If I get a list of meshes and a quadtree structure, I think I can handle it from there. Is this something that could be done dynamically at the initialization of the game, or do you think it would be too time consuming?

Also planned on using DrawIndexedPrimitive for the meshes, and I use it for drawing the tiles, but I just have 6 vertices for each quad, so I only get the gain from being able to quickly fill an index buffer for the tiles each frame. Thanks for the suggestion though!

Good stuff, anyone else?


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!