Sign in to follow this  
benwalker

[MDX] LineLists and z-indexing

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

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