Skip to main content
GameDev.net gamedev.net
🔒 Locked

Mesh Refinement

Started by NickGeorgia Apr 11, 2007 at 8:03 AM 4 replies 3.1k views
Original Post
NickGeorgia
NickGeorgia
I have started to implement a mesh refinement algorithm using a quad-tree structure(i.e. removing and adding vertices, coarse to refined). However, I am unclear about what approach would be best for rendering the final vertices and wanted to draw upon someone's experience. Some approaches use separate triangle strips, some use a single triangle strip, some one primitive at a time, others use fans, etc. Which one have you found to be the best approach or what would you recommend? Thanks. Edit: Forgot to mention-This is for a 3D terrain engine.
gpulove
gpulove
In a nutshell the best approach would try to minimize the data sent from RAM to the gpu or better from VRAM to gpu, and also minimize the number of transformed vertices.
Also it's important to notice that one implementation could perform better on specific drivers/hardware and worse on other drivers/hardware.
The worst approach would be to draw primitive by primitive, drawing using fans is a close one too. You could use separate triangle strips and draw everything in a loop for 1 to TERRAIN_WIDTH-1 = TERRAIN_WIDTH-1 passes, or use a big triangle strip.
When it comes to these things you only have one solution: TEST TEST TEST :).
Aressera
Aressera
use vertex arrays with glDrawElements() (assuming you're using openGL) This cuts down on the number of primitive draw calls dramatically as well as superfluous vertex/normal transforms.
Basiror
Basiror
Either triangle_strips concatenated with degenerate vertices

or index triangle lists and place them into VBOs
http://www.8ung.at/basiror/theironcross.html
NickGeorgia
NickGeorgia
Thanks for your responses. I have been looking over several papers such as Lindstrom and older ones. I think I will try to do a full triangle strip as used by Lindstrom's paper and as some of you suggest. As you say, gpulove, test test test. I'll try and post something in my journal once I have something substantial. Thanks again!
SoftwareGuy256
SoftwareGuy256
Using the primitive restart extension its possible to batch multiple tri-strips or fans for maximum vertex cache reuse. NVIDIA has triangle rendering optimzation code available in their SDK.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.