OGRE clipmaps terrain sample

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

curantil: Sure, no prob.
Here is an EXE and Mars data that you can just download [22MB] and run:
http://s1.upload.sc/request/82e52b8e5e9 ... 701cbb4be5

You can put it on your site also - so people will be able to run a demo easily.
Watch out for my OGRE related tweets here.
User avatar
Alexander
Gremlin
Posts: 175
Joined: Sat Aug 05, 2006 3:55 am

Post by Alexander »

Great work Assaf, downloading now.
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

Well damn - I've been working on my planet engine for a couple months now and here someone goes and beats me to the punchline (didn't even know there was an older planet engine hehe.)

Looks quite nice :D Are clip-maps really a better solution than geo-mip-mapping? The paper I read made it sound overly complex, so I ended up skipping it. I'll be using compressed heightmaps (probably ECW or something of my own) for some levels to alleviate computation and build the rest with noise functions. Works pretty well so far, just trying to find a suitable method to integrate both noise and "construction" on the planet (making canyons and things manually.)
User avatar
Lee04
Minaton
Posts: 945
Joined: Mon Jul 05, 2004 4:06 pm
Location: Sweden
x 1

Post by Lee04 »

@curantil: I noticed you said
I don't have an other VC yet

You can get a free MS VS express from MS if you download and register a copy this year. I got both the C# and C++ versions downloaded like that.

Time I can't help you with...

cheers

Lee04
Ph.D. student in game development
User avatar
Lee04
Minaton
Posts: 945
Joined: Mon Jul 05, 2004 4:06 pm
Location: Sweden
x 1

Post by Lee04 »

@Assaf Raman:

Hi Assaf

Great work...


I downloaded the project and tried to install it.

However Planet.cfg and other such files are missing.


Regards

Lee04
Ph.D. student in game development
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

Lee: Sorry about that. But you can get the missing files from the demo (22 MB).

Here is the Planet.cfg to save you time:
http://s1.upload.sc/request/f34ebe58547 ... 19e9b4ca2e

And here is the clipmap data:
http://tuan.kuranes.free.fr/ClipMap.7z
Watch out for my OGRE related tweets here.
User avatar
Lee04
Minaton
Posts: 945
Joined: Mon Jul 05, 2004 4:06 pm
Location: Sweden
x 1

Post by Lee04 »

2Assaf: Sorry ofcourse the files is in the exe version.

The link you gave me for the download however dosn't work it's says invalid link or something when I accept the download.


I try the suggested link and it says the same.

So I can't download the exe versions or this file.

The clipmap data was downloaded fine.
Ph.D. student in game development
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

Lee: The links worked for me fine - just now (9:57 AM).
I will e-mail the file to you.
Watch out for my OGRE related tweets here.
Phonomania
Kobold
Posts: 26
Joined: Tue Sep 14, 2004 12:56 pm
Location: israel
Contact:

Post by Phonomania »

Press CTRL when you click on 'download' link. or disable popup-blocker.
Hope this will help :)
User avatar
ahmedismaiel
OGRE Contributor
OGRE Contributor
Posts: 217
Joined: Wed Jan 25, 2006 11:16 pm
Location: Redmond,WA

Post by ahmedismaiel »

i like the mars demo alot ,but i find it seriosly slow when moving the camera,i have 7800 GT ,the frame rate is around 400-500FPS when not moving ,but when moving it doesn't go higher than 20FPS specially when the camera is near the terrain.

if you know how to optimize it ,i'm really interested in this demo
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

ahmedismaiel: I saw it also. I tried to find the reason for that and couldn't.
I guess you really have to go into the code to solve it.
I recommend you in this stage – to either solve it or just regard it as a reference when you write your own code.
I have a version of the code where I changed this demo to load all the information when it is starts – to role out disk paging hiccups – but it didn't help.
My guess is that it is an algorithm problem somewhere.
I think a much more naïve code approach should be taken then the one it the plant scene manager, the whole idea is not to do so much work on the CPU…
Watch out for my OGRE related tweets here.
curantil
Halfling
Posts: 70
Joined: Wed Dec 11, 2002 10:00 pm
Location: Belgium
Contact:

Post by curantil »

It could be that the reading of the maps from the harddisk is to slow for you. If you create a ramdisk and put the .clipmap there, you can see if it improves.

This is offcourse not a fix, but this way you can see if that is the bottleneck. It was that for me anyway.
User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4
Contact:

Post by tuan kuranes »

Any news on the clipmap "compression" front ?
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

tuan:
Well, I have studied how to do the compression but stopped working on it for now after discovering that the clipmaps terrain is very problematic for the solution I want to create.

I have a requirement to support the open flight format. I found out that same open flight files have irregular meshes – and not only grid ones – so I can’t easily split them up to clipmaps.

I have created an open flight to ogre mesh converter. I will post it in the showcase forum later today.

Here is an ogre mesh of an open flight terrain I have converted that will demonstrate an irregular mesh terrain.

Here is a link to the original flt terrain:
http://www.triangraphics.de/files/terrain_geotypic.zip

Here is my converted mesh (you will need the images from the previous link…):
http://s1.upload.sc/request/460b9cd4ca5 ... 50a0c87929

Here is a screenshot of the terrain before the conversion with an open flight viewer:
Image

Here is a screenshot of how it looks on the viewer from your site:
Image

Here is a screenshot of the wireframe:
Image

My converter creates only one submesh to each material so it is very efficient – because it uses the minimum batches needed to draw the terrain.

I get really good FPS with my converted meshes and it is sufficient for now to my purposes.

If you have any idea how to use the clipmaps technique with irregular mesh sources – do post a replay and explain.
Watch out for my OGRE related tweets here.
curantil
Halfling
Posts: 70
Joined: Wed Dec 11, 2002 10:00 pm
Location: Belgium
Contact:

Post by curantil »

This is not with clipmaps, but it is an algoritm for planets and usable for irregular meshes http://www.crs4.it/vic/data/papers/ieeeviz03-pbdam.pdf
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

curantil: Well, irregular meshes are not the only problem.
I want to have roads with a road texture - different then the one of the satellite image of the terrain. None of the articles I saw handle it.

My current idea is a new approach to the problem – I am going to convert a big open flight terrain to a lot of ogre meshes in different levels of detail. Every level of detail is going to have a square root less faces then the previous one – and 4 times the size.
I am going to create my meshes is a special way that will be very efficient to use later on.

1. I am going to merge all of the different textures of a mesh to a single texture.
2. I am going to create a single triangle list of all the faces.
3. I still need to think of the case where the texture is a repeating texture where you have a tex cord above 1.
4. This mesh drawing is a single batch.
5. To create the next level of detail I will take 4 meshes that are next to each other in a square – and merge them to a single mesh, and a single texture. I will resize the texture to be a quarter in size. I will use a progressive mesh algorithm to lower the number of triangle list to be a quarter of its original size. My progressive mesh algorithm does not collapse the vertexes that are on the edge of a terrain mesh.
6. I will use the meshes when I draw the terrain – a quad-tree that loads\unload by the distance from the camera.

My idea handles the trees, roads and houses as part of the terrain – and with terrain – this is the biggest problem to implement.

What do you think?
Watch out for my OGRE related tweets here.
curantil
Halfling
Posts: 70
Joined: Wed Dec 11, 2002 10:00 pm
Location: Belgium
Contact:

Post by curantil »

Assaf Raman wrote: My idea handles the trees, roads and houses as part of the terrain – and with terrain – this is the biggest problem to implement.
Roads is not a bad idea I think. But I'm not sure if using the same technique for terrain and buildings and certainly trees is a good idea. There are different alogirtms better suited for these different types of objects.

I mean, for tree e.g. you can use billboards when they are distant. Rendering a mesh of it will give not the same visual quality for the same amount of work.
User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4
Contact:

Post by tuan kuranes »

If you have any idea how to use the clipmaps technique with irregular mesh sources – do post a replay and explain.
You can convert the irregular terrain meshes into heightmap in a very simple way, just getting height at regular grid spaced point on the mesh.
Then convert each height into a 8bits or 16bits data you 'll save into png/raw.

If making your own version of getting height seems to complicated, you can use a library like Opcode (search for that in OgreOpcode), load terrain as an opcode "trimesh", launch vertical opcode ray queries on the terrain on each grid point and you'll have the terrain height.
If you want make your own and speed isn't a problem, it's just about finding triangles where points lies nead in using AABB of triangles, then convert triangles into planes and find ray - plane intersection. (googling for any of these will give you loads of source code.)
My idea handles the trees, roads and houses as part of the terrain – and with terrain – this is the biggest problem to implement.What do you think?
Doesn't seem that good to me.

-> single triangles list means being limited to 16bits index size... that's small.. you 'll have multiple batch for sure.
-> terrain will surely be complex enough to fill a single batch / texture on its own.
-> repeating texture needs special case. Atlas texture are not meant to be used as repeated texture.

Each of these objects need different LOD schemes, that will give real flexibility.
- Terrain Lod: geomorphing, clipmaps.
- Roads : can be object when nears and just texture pixel at distant views
- Houses are very simple objects using lots of different texture that will surely ends in a single "houses" altas texture and batch. This can be faded away and distance where it appears can be a user LOD tweakable info.
- Tree really fits well with some impostor/billboard system.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

You can convert the irregular terrain meshes into heightmap in a very simple way, just getting height at regular grid spaced point on the mesh.
Well, if I will do that - I will still have problems handling the roads on the terrain.
Road integration into the terrain is best when the road is baked-in to the terrain mesh and is an integrated part of the terrain – then you don't have Z-fight problems and you can have a repeating texture for it and all the other benefits of having it as a part of the terrain. I don't see how I can do it easily using clipmaps or geomorphing.
Also there is no easy solution for tunnels, bunkers, and any case when you need "holes" in the terrain.

If I there is any good way to solve the case of the roads and holes with clipmaps or geomorphing terrain - do tell.
Watch out for my OGRE related tweets here.
User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4
Contact:

Post by tuan kuranes »

you can have a repeating texture for it
using it's own texture and texture coordinates set, not texture atlas then.
I don't see how I can do it easily using clipmaps or geomorphing.
Solution listed there are not that hard :
http://www.ogre3d.org/phpBB2/viewtopic. ... 258#189258
Also there is no easy solution for tunnels, bunkers, and any case when you need "holes" in the terrain.
Apart from making them as mesh, which is no easy solution, no.

Have to balance LOD flexibility+terrain hole handling against fixed mesh LOD rigidity.
SirKnightTG
Gnoblar
Posts: 10
Joined: Mon Feb 26, 2007 4:46 pm
Location: TX

Post by SirKnightTG »

This thread is a little old now but I was wondering if there's anything new on the topic of terrain clipmapping in OGRE?


Thanks!
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

I have moved on to other things – so no one is working on this issue now.

I decided that this type of terrain is not relevant to games or simulation because it is hard to integrate into it roads, water and other "baked-in" meshes that change the grid of the mesh of the terrain.

What type of project are you creating and are you sure this type of terrain is the best choice for you?
Watch out for my OGRE related tweets here.
User avatar
Alexander
Gremlin
Posts: 175
Joined: Sat Aug 05, 2006 3:55 am

Post by Alexander »

I think that geometry clipmaps can work great for games if you're conscious of the limitations (we do most level design including rivers and such on the heightmap, not with meshes).

Anyway, an implimentation is around the corner. Filou has come up with a great solution and is releasing it (this weekend probably) under the CeCILL license. Porting it to Ogre will be very simple as only the render targets and instancing are api specific. If anyone is interested in geometry clipmaps for Ogre, this is certainly a great opportunity:

http://www.gamedev.net/community/forums ... _id=439770
User avatar
Falagard
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2060
Joined: Thu Feb 26, 2004 12:11 am
Location: Toronto, Canada
x 3
Contact:

Post by Falagard »

Too bad the CeCill license is essentially the same as GPL, it makes it unusable in any of my projects.

Does anyone have Assaf Raman's original source code and demos? The links are broken.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

Watch out for my OGRE related tweets here.
Post Reply