Jump to content
  • Advertisement
Sign in to follow this  

[MDX] LineLists and z-indexing

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

Hi, I'm working on a project that involves drawing sphere surface segment shaped meshes and then overlaying a grid over the top. Because the meshes drawn are required to change depending on the zoom-level used, I've been controlling the zbias to eliminate fighting on coplanar tiles. This has worked well, but now I'm trying to draw my grid. I construct the grid when the application initialises - basically I divide the tile up and do a ray trace intersection on the tile: it's quicker than me reloading Gb's of heightmap data on the fly. From this, I construct a vertex buffer and index buffer to draw rectangle edges (not triangles) and hence construct a regular grid. The Vertex Buffer is a CustomVertex.PositionOnly type, and I draw using DrawIndexedPrimitives. Great though this is, there is a major problem - namely culling. Somewhere along the lines, things are getting mixed up. I can either see all of my (spherical) grid over my tiles - including that that should be behind the tile, or I see no grid at all. I can't convert the grid to a mesh to take advantage of the back face culling since that draws triangles and not rectangles. any suggestions? at the moment it looks like i'm going to have to construct some elaborate index buffer scheme that involves skipping lines that are out of view, but any other thoughts would be much appreciated benw

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • 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!