Jump to content
  • Advertisement
Sign in to follow this  
Frozen

GeoMipMapping question

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

Ok. So, I made a 3D Terrain, using GeoMipMapping, but I have a few questions. Each patch has it's own vertex buffer and index buffer, so I just use DrawIndexedPrimitive for each patch. But this way, it is very hard to fill the gaps between two patches with different levels of detail. So, is there any other good method? Should the vertex buffer be declaired only once, and all the patches to use it? But, if I do this, my vertex buffer would be to large, and I can't use index buffers on 16 bits. Help pls.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Hi,

in fact, you do the inverse : You create one vertexbuffer for each patch and have only one indexbuffer per LOD.

To fill the gaps the paper about "Fast Terrain Rendering using Geometrical Mapping" (pdf) chapter 2.3.2. There's a detailed desciption in one of the game programming gems books (second I think) which also has some sample code.

Hope this helps,
Metron

Share this post


Link to post
Share on other sites
Yes, I have a vertex buffer for the Patch, and an index buffer for each Lod. In "Fast Terrain Rendering using Geometrical Mapping", it says that you have to omit some vertices. I understood this, but I find it very hard(and unoptimized) to modify the index buffer for that Lod. Is it a simple method to do that?

Share this post


Link to post
Share on other sites
You should not create the index buffer content on the fly but create all buffers for the different LODs at program start. This is more or less simple.

PM me your email so I'll send you some example code tomorroy evening that can generate the LOD for every patch size including the gap filling index buffers and some render code. You'll have to adapt it for your needs.

It's too much code to post here.

Metron

Share this post


Link to post
Share on other sites
Frist of all .. no it is not an easy thing to do .. so do nto look for any short cuts. Filling the gaps is involed and difficult, toatleast that is what I found it to be.

Here is what I do to fill the gaps. For each patch, I maintain 1 vertex buffer and 3 index buffers. 1 index buffer is for drawing the whole patch, and the remaining two are for stitching, one to the right and other to the bottom. (ofcourse you can optimize by having just 1 index buffer for all the patches. For this scheme to work, the patches must overlap by 1 pixel on right and bottom, and then the index bufefr simply draws the stitch triangles between last and second last row (for sticthing to bottom) or column (for right stitching).

What remains to be determined is the exact stitc pattern. This is easily computable given the lods of each patch. The lod difference translates directly into the number of skipped vertices. Draw a fan from the high igh lod side to low lod side!

You can get a sample of this trick from terrrain1.zip

You may need VC7.0 runtimes which can be downloaded from here



Share this post


Link to post
Share on other sites
Thx a lot guys. Metron, thx for your code. Even if it is quite hard to understand, it is usefull. AQ, thx too.

Share this post


Link to post
Share on other sites
So.. I managed to fill the gaps, but I have a horrible FPS.
Please download:
http://www.geocities.com/alin9d/Proiect.zip
AQ, you said you have just 3 indexbuffer, one for rendering the patch, one for right stitching, and one for buttom stitching.
But I have 5 index buffers. 4 of them are used for right, left, bottom and top stitching. So, explain me what do you do to use just 2 index buffers for that.
I'd also need some links to QuadNodes(I think that's how they're called) tutorials.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!