SOAR terrain...

Started by
26 comments, last by GameDev.net 18 years, 4 months ago
Strictly speaking, for node C, its parent is B and its GRANDparent is A. Its child is D and further descendants are E and F.

However, to avoid terrain cracks in your example, an additional node would have to be active on edge A to B, and would result in two extra triangle bisections to join with F.

Advertisement
And having posted that, I've just noticed there would have to be a couple of other edge bisections in the right hand triangle to avoid other cracks.

Justin.
Thanks but this is speculative, I'm just trying to understand how there are two parents and four children
Alright now I see it, it has to do with that Directed Acyclic Graph they kept talking about.



In this, for node A, the children are b, c, d, and e, and the parents are P1 and P2. This is why you precalc from the bottom up and refine from the top down. Nodes on the edge only have two because the other two are outside the map's boundaries.

What I'm becoming curious about now is screen space error. Apparently during runtime you're supposed to project the object space error of a node onto it's bounding sphere at the closest point to the camera to get "screen space error." What is that all about?

Also, how do I handle the index list? I mean, do i allocate a huge chunk of data for indices ahead of time and then repeatedly fill it in during refinement? This seems like a waste since I would probably have to do something like 6 times the product of the dimensions of the map just to ensure i don't run out of space for indices. Maybe this is a problem with trying to do SOAR in DirectX instead of OpenGL; OpenGL is procedural, wheras DirectX is more OO. Should I be using dynamic VBs and IBS?

Finally, are you telling me that I should have a separate application which first creates a huge data structure with pointers to children and parents, calculates all the errors and whatnot, and then saves this information to a file for me to load by my refinement program (which therefore will not have to explicitly keep track of these children and parents)?

[Edited by - Funkymunky on December 7, 2005 10:03:10 PM]
you don't need any pointers at all
all you can do with simple array of heights and max-errors
the structure is recursive so you don't really need to keep it anywhere.
so how do you traverse from bottom up then? How do you know which the parents and children are?
easy.
if this is root level

*---*
|\ |
| \ |
| \|
*---*

then you subdivide it like this

*---*
|\ /|
| + |
|/ \|
*---*

and array at position '+'keeps all information (it's 2,2 here)
then if you split right triangle you get

*---*
|\ /|
| *-+
|/ \|
*---*

data at 4,2

and so on

i just don't understand why would you want any information about parents at all
whole idea behind SOAR is not to use it at all
only when precalculating you need properly set errors
and for that you need only to lookc carefully at patterns triangles create

like

odd level
*-*-*
|/|\|
*-*-*
|\|/|
*-*-*

even level

*---*
|\ /|
| * |
|/ \|
*---*
So, do I go through the whole process of recursively splitting down the triangles until i get to the leaves, or is there some formula I can use to find the parents and children for any given node?
you don't need parents
you calculate errors bottom up
for each triangle error is calculated based on its children
(easy to find) and children of it's simmetric triangle
so if you have triangle ABC

A---B
| /
| /
|/
C

you find symmetric triangle BDC

A---B
| /|
| / |
|/ |
C---D

then to find children you find O

A---B
| /|
| O |
|/ |
C---D

and children are AOB,COA,DOC,BOD
you take their errors (calculated on lower level)
calculate new error for CB line as distance of O to real terrain
find MAX and keep that value in array at position O
So how about this question, do the nodes in the corners of the map have error values? Because they will never be found as midpoints.

I simply don't understand. That point O could be in any number of triangles, from the huge one that encompasses the whole bottom portion of the map, to the tiniest little one that is a piece of a mountain at the map's center. How do you assign a single error to it?

Biki thanks for this help, you are a godsend my friend

[Edited by - Funkymunky on December 9, 2005 3:26:58 AM]

This topic is closed to new replies.

Advertisement