frustum culling with terrain made of strips
How would you do frustum culling with a terrain that is drawn using several vertex array''d triangle strips ? Would you check each strip against the frustum culling and simply draw any strips that are partially in it ?
Is it possible to mark only certain indices to be drawn with a LOCKED vertex array ?
Is it better to cut the strips into smaller strips and check those against frustum culling ? I guess the real question is the advantage (if any) of drawing LOTS of triangles in a triangle_strip vs being able to cut a bunch of them but passing more smaller triangle strips.
Nitzan
-------------------------
www.geocities.com/nitzanw
www.scorchedearth3d.net
-------------------------
1/ yes
2/ not really
3/ arange your strips as a block eg instead of a strip 8 tris wide + 1 deep make the strip 8wide + 8 deep
http://uk.geocities.com/sloppyturds/gotterdammerung.html
2/ not really
3/ arange your strips as a block eg instead of a strip 8 tris wide + 1 deep make the strip 8wide + 8 deep
http://uk.geocities.com/sloppyturds/gotterdammerung.html
How do you specify strips that are more then 1 deep ?
Can you show me an example of how to specify a 2x2 (or larger if you want to bother typing more).
What I am confused about is since its triangle strips... how do you pass more then one strip at once ?
Nitzan
-------------------------
www.geocities.com/nitzanw
www.scorchedearth3d.net
-------------------------
Can you show me an example of how to specify a 2x2 (or larger if you want to bother typing more).
What I am confused about is since its triangle strips... how do you pass more then one strip at once ?
Nitzan
-------------------------
www.geocities.com/nitzanw
www.scorchedearth3d.net
-------------------------
Hehe, yes I realize that. What I dont understand is if you are sending all 8 strips as one chunk to the vertex array, how do you arrange the indices so the VA knows to stop drawing the first strip and start drawing the next one ?
I thought the whole idea of triangle strips is that it always grabs the next vertex and appends it to the current strip ? Therefore you only need 4 vertices for 2 triangles (instead of 6), 6 for 4 triangles (instead of 12), 10 for 8 (instead of 24), etc...
If I am completely and utterly wrong (happened before and its sure to happen again), can someone point me to a web page explaining triangle strips and how to place several strips into one VA ?
Nitzan
-------------------------
www.geocities.com/nitzanw
www.scorchedearth3d.net
-------------------------
I thought the whole idea of triangle strips is that it always grabs the next vertex and appends it to the current strip ? Therefore you only need 4 vertices for 2 triangles (instead of 6), 6 for 4 triangles (instead of 12), 10 for 8 (instead of 24), etc...
If I am completely and utterly wrong (happened before and its sure to happen again), can someone point me to a web page explaining triangle strips and how to place several strips into one VA ?
Nitzan
-------------------------
www.geocities.com/nitzanw
www.scorchedearth3d.net
-------------------------
only 1 strip is needed for 2x2 or 8x8 etc search for ''degenerant triangles''
http://uk.geocities.com/sloppyturds/gotterdammerung.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html
you don''t need degenerated triangles for 8x8 patch... think of strips like zigzag
//////
\\\\\\
//////
\\\\\\
sorry for bad ASCII art
There are more worlds than the one that you hold in your hand...
//////
\\\\\\
//////
\\\\\\
sorry for bad ASCII art
There are more worlds than the one that you hold in your hand...
You should never let your fears become the boundaries of your dreams.
zedzeek... so the idea behind degenerate triangles is to use a bunch of extra vertices in order to let the triangle strip "turn the corner" so to speak ? Does 1 strip go up and the next down then up etc .... or do they all go in one direction ?
So I guess the above example uses 9 vertices and 12 indices instead of 24 of each. Which is still very nice despite the extra vertices!
So is this right ?
DarkWing, if you have a different idea can you explain it here ?
Nitzan
-------------------------
www.geocities.com/nitzanw
www.scorchedearth3d.net
-------------------------
* | /|\ | | \|/ | *5----6,8----7|\ |\ || \ | \ || \ | \ || \ | \ || \| \|3---4,10----9|\ |\ || \ | \ || \ | \ || \ | \ || \| \|1---2,12----11
So I guess the above example uses 9 vertices and 12 indices instead of 24 of each. Which is still very nice despite the extra vertices!
So is this right ?
DarkWing, if you have a different idea can you explain it here ?
Nitzan
-------------------------
www.geocities.com/nitzanw
www.scorchedearth3d.net
-------------------------
you connect strips like this
|---------------|
| /| /| /| /|
| / | / | / | / |
|/ |/ |/ |/ |
|---------------|
|\ |\ |\ |\ |
| \ | \ | \ | \ |
| \| \| \| \|
|---------------|
so the whole thing is just one strip..
I'll post the code when i get home....
edit :
wow! ascii turned realy bad... just hink of reversing every other strip.. that way you can connect them without using degenerated tris...
There are more worlds than the one that you hold in your hand...
[edited by - _DarkWIng_ on March 14, 2002 4:41:00 PM]
|---------------|
| /| /| /| /|
| / | / | / | / |
|/ |/ |/ |/ |
|---------------|
|\ |\ |\ |\ |
| \ | \ | \ | \ |
| \| \| \| \|
|---------------|
so the whole thing is just one strip..
I'll post the code when i get home....
edit :
wow! ascii turned realy bad... just hink of reversing every other strip.. that way you can connect them without using degenerated tris...
There are more worlds than the one that you hold in your hand...
[edited by - _DarkWIng_ on March 14, 2002 4:41:00 PM]
You should never let your fears become the boundaries of your dreams.
I was kinda under the impression that you must have two degenerate tris between each strip you stitch together...
BTW, for any who don't know, degenerate tris are tris that have no area (e.g. if two of a tri's vertices coincide)
Here's how you can stitch them together:
vertices...
123
456
789
the order you specify them to create a single tri strip is:
1,4,2,5,3,6,6,9,5,8,4,7
the degenerate tris in this set are 3,6,6 and 6,6,9
if you try to leave them out, you will get a tri linking 3,6,9 which may look very weird if you are drawing a terrain and it pops above the surface (e.g. if 3 and 9 are higher than 6).
you can extend this technique to any size strips (patches) you want... the more you do, the more its worth it (as the degenerate tris become less significant overhead)
[edit] regarding your original question, the best solution would be to do as zedzeek suggested, and make 'patches' of middling size (play with it and see what gives better results).
Even better, organise them in a quadtree for more efficient frustum culling (the size of each patch determining the smallest node size).
[edited by - Bad Monkey on March 14, 2002 8:22:57 PM]
BTW, for any who don't know, degenerate tris are tris that have no area (e.g. if two of a tri's vertices coincide)
Here's how you can stitch them together:
vertices...
123
456
789
the order you specify them to create a single tri strip is:
1,4,2,5,3,6,6,9,5,8,4,7
the degenerate tris in this set are 3,6,6 and 6,6,9
if you try to leave them out, you will get a tri linking 3,6,9 which may look very weird if you are drawing a terrain and it pops above the surface (e.g. if 3 and 9 are higher than 6).
you can extend this technique to any size strips (patches) you want... the more you do, the more its worth it (as the degenerate tris become less significant overhead)
[edit] regarding your original question, the best solution would be to do as zedzeek suggested, and make 'patches' of middling size (play with it and see what gives better results).
Even better, organise them in a quadtree for more efficient frustum culling (the size of each patch determining the smallest node size).
[edited by - Bad Monkey on March 14, 2002 8:22:57 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement