Archived

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

Raloth

texture splatting & quadtrees

Recommended Posts

Raloth    379
I have a map with a size of 512x512 (well, it could be any power of two > 32) that is split up into a quadtree. Each chunk is 32x32. I plan on doing something similar to texture splatting (http://www.cbloom.com/3d/techdocs/splatting.txt), but I''m trying to make it as efficient as possible. This is how the author describes it: 1 vertex buffer for every 32x32 chunk to render, you set each visible chunk, then set the textures and index buffers that go with it The obvious problem with this is that if two chunks share the same texture then you have a rather painful redundant check (or many if several chunks are visible). I was thinking, why not expand the vertex buffer to 128x128? This would leave it with a size of 2.5 megabytes, roughly what the recommended size is. However, it doesn''t completely eliminate redundant texture setting, and the number of DrawIndexedPrimitive calls stays exactly the same. When you stand on a corner where it is setting 4 buffers and look down, it would even be slower than the original method . Would it be worth it to make the vertex buffer larger? It kind of muddles up the quadtree, since it has to set the vertex buffer when it finds it then go down further until it finds the index buffers. Better yet, maybe there is a way to achieve a similar effect without worrying about the redundant textures?

Share this post


Link to post
Share on other sites
Raloth    379
Anyone? Only 6 people have even read the thread . New question, although related: I could simply keep an array of vertex data for each section and copy it to a dynamic vertex buffer before I render. Does the removal of the wasted SetTexture and SetStreamSource calls make up for the slower rendering of a dynamic vertex buffer?

Share this post


Link to post
Share on other sites