PDA

View Full Version : Terrain Lod/Occlusion



03-19-2003, 09:12 AM
Hello Everyone!

I've been "googling" searching for a LOD that might work on my terrain "engine",
but didnt find anything that could be applied, or I just didnt know how to search or what to search for.
Anyway, my terrain is based on an Octree and it has Frustum Culling and after a certain distance it renders no more. I get 6 fps on Laptop Celeron 600 with a graphics card with 4 MB of vid mem.

Can anyone sugest me a LOD or occlusion
algo.
Thanks in advance.

03-19-2003, 09:21 AM
I forgot to mension that, ive been looking into geomipmapping but since my "engine" supports caverns and stuff like that its not possible to implement it. (correct me if im wrong plz)

Miguel_dup1
03-19-2003, 10:14 AM
Well, I dont know what performance you micht get with that laptop... But I wrote a ROAM demo available at: http://cheo.resnet.wayne.edu/miguel/

good luck,

Miguel Castillo

03-19-2003, 10:33 AM
It looks very good http://www.opengl.org/discussion_boards/ubb/wink.gif
Is ROAM capable of handling caverns and other stuff similar, like those stone arcs?

Miguel_dup1
03-19-2003, 12:29 PM
Thank you

To be honest, I have never tried, but I am sure you can do it.

The problem would be how you have your data because ROAM is normally used with heightmaps, which are flat pictures. Caverns would be kind of like two heightmaps together; one for the lower part and another for the upper part. So you would have to think of a way to actually create those caverns. This could be quite complex also because ROAM is based on error metrics that work in two dimensions. You would have to get over this and I think this is the hardest part of the problem....

What I would do is create the cavern with a 3d modeler and dump it on the map... Do some nifty tricks with texturing to decrease possible visual error.


Miguel Castillo


[This message has been edited by mancha (edited 03-19-2003).]

Mihail121
03-19-2003, 09:46 PM
Ei dude!That looks very cool.Can you please tell me what ROAM really is and can we use some parts of it in our engine?

Miguel_dup1
03-20-2003, 07:13 AM
This would be a long thread, but sure, we can discuss ROAM. I think many people would benefit from it.

And yes, you can use my engine for anything but commercial, for which you would have to talk to me about.

If you want to use parts of my engine, just give credit where credit is due and we will be set... http://www.opengl.org/discussion_boards/ubb/smile.gif A link to the places where you use my engine would be nice. I like to see other people's work.

Miguel Castillo



Originally posted by Mihail121:
Ei dude!That looks very cool.Can you please tell me what ROAM really is and can we use some parts of it in our engine?

Miguel_dup1
03-20-2003, 07:42 AM
ROAM is a way to do progresive meshing. You can make it view dependent, which is the main reason why ROAM came up in the first place. You can make it frame coherent, meaning that ROAM can be set to produce as many or as little triangles per frame as you want as long as there is time each frames. ROAM makes use of a bin tree to implicitly create triangles. The importance of this method with binary trees is that you are guaranteed a mesh without T-junctions, therefore no cracks.

What in the world does "implicitly create triangles" mean?
I asked myself this question 100000000 when I was reading papers and tutorials on ROAM. But to make it easier on the reader, implicitly storing triangle means that you dont store triangles' coordinates, instead, you recursively split a triangle and pass down the coordinates of the split triangle. How do you keep track of the triangles then?
You use the bin tree where each node represents a triangle. So, ROAM is very cheap on memory.

This is a small overview. Try reading the tutorial in http://gamasutra.com That was my model from which I did my code, so you will find plenty of similarities.


Miguel Castillo

[This message has been edited by mancha (edited 03-20-2003).]

03-20-2003, 07:54 AM
I was thinking about using something similar to what is used on models (player models and stuff), but im not sure if its gonna work with my octree.

Btw, does ur engine uses Diamond instead of tris?

Miguel_dup1
03-20-2003, 09:34 AM
Well, diamonds is just a name for a pair of triangles that can be split. There maybe other definitions, but in terms of ROAM, that's what people refer to. So, yes, the engine has diamonds that are made out of triangles. http://www.opengl.org/discussion_boards/ubb/smile.gif The distinction between diamonds and just a set of triangles is very useful when we try to merge queues of triangles. For example, you have a bin tree that was split in the previous frame, and in the current frame we need to split it further, we start splitting those diamonds in the tree.

I would be very happy if people extend it my engine, or wanted to help extend it.


Thank you,
Miguel Castillo


Originally posted by Zinco:
I was thinking about using something similar to what is used on models (player models and stuff), but im not sure if its gonna work with my octree.

Btw, does ur engine uses Diamond instead of tris?

03-21-2003, 01:52 AM
Why wonder if its my bad searching way or there arent tutorials about.. maps with caverns and arcs.. I mean, all tuts I get are for heightmaps :|. Maybe Ill do occlusion instead of LOD, might not be as good as LOD in huge areas, but it always help http://www.opengl.org/discussion_boards/ubb/smile.gif.

Mancha, thx for the replies http://www.opengl.org/discussion_boards/ubb/smile.gif

JustHanging
03-21-2003, 03:07 AM
For my thoughts about this, see http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/009061.html
, especially my second post.

-Ilkka

03-21-2003, 04:08 AM
My pseudo engine is capable of handling caverns and any kind of geometry, but Its slow, what i whant is a way to increase my fps (it would probably run good on high end PC's, but since I dont have one and want ppl who dont have it either to be able to run it better http://www.opengl.org/discussion_boards/ubb/smile.gif )

In ur post I dindt understand "you can form nice roads by offsetting those vectors a little so that you get polygon edges match road's edge."

what do u mean by offsetting?

(sorry for my terrible english http://www.opengl.org/discussion_boards/ubb/wink.gif )

JustHanging
03-22-2003, 02:56 AM
I ment just altering the vertice's x and z positions slightly so that the polygon edges line up with the road's edges. But that's not so helpful to you, I'm afraid, did you read the other post, where I described the workflow to creating loddable geometry? I think that is more suited to your problem.

-Ilkka

03-25-2003, 03:43 AM
I read it, and it looks like a LOD http://www.opengl.org/discussion_boards/ubb/wink.gif
anyway, until i have a better machine I wont be working on landscapes.. 4fps is very depressing when rendering wireframe.. imagine textured and with light.. below 0 fps :\

cheers

JustHanging
03-26-2003, 12:14 AM
Originally posted by Zinco:
4fps is very depressing when rendering wireframe.. imagine textured and with light.. below 0 fps
Unlikely. The typical hardware targetted for games usually renders textured triangles a lot faster than lines. Lighting is usually well accelerated too. But no matter what you do, you can't render big landscapes fast unless you use some sort of level of detail. Occlusion is much harder to do and often leads to only small speed increases when compared to LOD.

-Ilkka

03-26-2003, 02:13 AM
Ya, you are right, once more http://www.opengl.org/discussion_boards/ubb/wink.gif

Hey, check on this http://www.darkandlight.com/

it looks very cool, I think they only use heightmaps. What do you think?

Maybe I quit the idea of caverns and stuff like that :\, I sure like them http://www.opengl.org/discussion_boards/ubb/biggrin.gif (Mines and dungeons)

Miguel_dup1
03-26-2003, 04:00 AM
Very nice shots. http://www.opengl.org/discussion_boards/ubb/smile.gif

Why should you quit the idea of caverns????
It is a great idea, but I think it is better to model the caverns with something like 3d studio and then dump it on the landscape... I dont know, just a thought...
BTW, unreal tournament 2k3 has a map that is inside a caverns... VERY nice stuff... I am sure they used the modeling first then dump approach.

Miguel Castillo



Originally posted by Zinco:
Ya, you are right, once more http://www.opengl.org/discussion_boards/ubb/wink.gif

Hey, check on this http://www.darkandlight.com/

it looks very cool, I think they only use heightmaps. What do you think?

Maybe I quit the idea of caverns and stuff like that :\, I sure like them http://www.opengl.org/discussion_boards/ubb/biggrin.gif (Mines and dungeons)

03-26-2003, 07:41 AM
I do have a 3D editor in wich maps will be made (but it needs some stuff remade if not all), and that idea had crossed my mind but, it might not be very realistic. Anyway, with lights using triangle fans I get +- 8fps hehe
Ill have to think very well what to do.
As soon as i get some real spare time, Ill try to learn the ROAM algo.
Thx for the reply's http://www.opengl.org/discussion_boards/ubb/smile.gif

Miguel_dup1
03-26-2003, 10:53 AM
Let me know if you need help with ROAM... And of course, feel free to use my implementation.

Miguel Castillo

03-27-2003, 12:14 AM
Thx, but most times i get more confused looking into others code, so i always end up making my own, but ill probably be asking u something about the algorithm.. havent understand it yet.. maybe the flipcode's tuts isnt very clear http://www.opengl.org/discussion_boards/ubb/frown.gif

be kewl

jebus
03-27-2003, 04:50 AM
i've read up on some ROAM implementations and they seem pretty nifty. i think the game IGI used ROAM for it's terrain. if you were walking outside and looked at the hills up in front of you, as you walked forward you could see points in the mesh moving, as the triangles split and created other ones. and, as manch said, it was all view dependent. very nifty, i'm gonna take a look at your's (mancha) when i get home. i also am trying to tackle merging my indoor BSP engine to also use some sort of outdoor type of rendering (would like to use ROAM but the merga may prove to be difficult, may have to use quadtrees/octtrees)

jebus

Miguel_dup1
03-27-2003, 10:19 AM
@jebus:

Let me know if you have questions about my code... As of now, I am adding collision detection to the terrain; it is pretty nice. I will give you a shout if you want to get the latest.

@Zinco:

I know it is very confusing when you try to learn by looking at others' code... But I really meant to say that you can ask me any questions you have about ROAM and I will try to answer them...


Miguel

Miguel_dup1
03-27-2003, 10:53 AM
http://cheo.resnet.wayne.edu/miguel/my_stuff/my_roam/my_roam04.zip


This is a little peak to what is coming. It has a new math library. It has a new camera system using quaternions (beautiful). It has some changes to the frustum class done to incorporate my new math library for collision detection... I added a little quick hack to be able to walk on the terrain; it is very rough and sad. If you want to do a flyover camera the way I have it in older versions, simply comment out in the render (game class) function the line for setting the CameraY.


Miguel

03-28-2003, 03:40 AM
Hey mancha, you could start explaining ROAM (start by the Data structures, i thinks its always a good start to understand everything http://www.opengl.org/discussion_boards/ubb/smile.gif)
Thx