TerraBuild

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
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 »

Added the 8bits heightmap save and some speed optimizations, and a special terrainmesh so that you can try 32bits indices.

source

My advice would be to swtich to a specialized terrain manager to get more option and vizualisation speed. Having 80000 tris just for a 200x200 heightfield is limiting. same heightmap with Lod would be at most 10.000. Perhaps you Should generates mesh from heightmap, instead of heightmap from mesh.
That would ease a lot creation and visualisation of 1024x0124 maps.

User avatar
Borundin
Platinum Sponsor
Platinum Sponsor
Posts: 243
Joined: Fri Oct 03, 2003 5:57 am
Location: Sweden
x 2
Contact:

Post by Borundin »

Thanks for your contribution Tuan! And you cleaned up my code too :o Very nice :D

Your new 32-bit index fix and the speed optimization were great. To get new size to work I had to change the increment in Update to compensate for new size (in case anyone else tries this) else you end up with a really strange landscape. This function probably needs some more attention since you wont get the same terrain as the orginal algo. Anyway good job!

I also tried to save as heightmap but it looked kind of ,... not quite right. Hard to explain. Have you tried it succesfully ?

Over to some other concerns in this thread.

Lodes: libnoise looks good, didnt know about that one. Have to investigate soon. I really liked that incredible planet simulation they had!

Clay: Using a fractal algo as TerrainSceneManager source would indeed be a great way to utilize this technique. Havent studied the different Terrain Managers so hard to say if this would be difficult or not. About the "full tile" scroll. I think all you have to do is change this code:

Code: Select all

		if(we.window->getName() == "UpBtn")
			testft->AddZoff(-128.0);
		if(we.window->getName() == "DownBtn")
			testft->AddZoff(128.0);
		if(we.window->getName() == "LeftBtn")
			testft->AddXoff(-128.0);
		if(we.window->getName() == "RightBtn")
			testft->AddXoff(128.0);
Into:

Code: Select all

		if(we.window->getName() == "UpBtn")
			testft->AddZoff(-1024.0);
		if(we.window->getName() == "DownBtn")
			testft->AddZoff(1024.0);
		if(we.window->getName() == "LeftBtn")
			testft->AddXoff(-1024.0);
		if(we.window->getName() == "RightBtn")
			testft->AddXoff(1024.0);
tuan kuranes: About licensing. The license you put in TerrainMesh.h sounds perfect for me too. Im going to add a slightly different phrased license in the download when I get the chance.

Sputnick: weathering and fluvial erosion code sounds intresting. I guess this will greatly improve the realism of terrain. Unfortunately sounds like a very slow process, or? But once youre happy with the general look of landscape this could be used to finish it off so to speak.
Image : Image

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 »

@Borundin : I'll re-check heightmap. I tested it successfully at first, but didn't recheck it after terrain mesh changes. Surely a bad image index thing.

tonyhnz
Greenskin
Posts: 101
Joined: Fri Feb 25, 2005 3:54 am
Location: Florida

Post by tonyhnz »

FYI - the TerraBuild.zip seems to be missing the TerraBuild_01.xml which has the gui layout in it by the looks.

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 »

@ Borundin : heighmaps seems fine here.

@ tonyhnz : My source is just an update to Borundin's one. You'll need them before.

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 »

Updated my source adds.

I didn't dived yet into cegui so... I added some terrain generators (plasma, fault, particledeposition) and an erosion filter, but they're all hardcoded. (they're very fast, 150 erosion filter applying is nearly instantanous here. also added a 16 bits raw save.)

If you're interested :
source
(still need Borundin zip.)
Last edited by tuan kuranes on Sun Mar 13, 2005 8:11 am, edited 2 times in total.

User avatar
Clay
OGRE Community Helper
OGRE Community Helper
Posts: 518
Joined: Wed Mar 17, 2004 4:14 am
Contact:

Post by Clay »

Very nice guys. You might consider getting a SF project so we can be sure to work on the current code. =)

User avatar
Sputnick
Greenskin
Posts: 110
Joined: Wed Sep 08, 2004 11:49 pm
Location: Lausanne, Switzerland

Post by Sputnick »

Borundin wrote:Sputnick: weathering and fluvial erosion code sounds intresting. I guess this will greatly improve the realism of terrain. Unfortunately sounds like a very slow process, or? But once youre happy with the general look of landscape this could be used to finish it off so to speak.
It's not realtime for sure, but it's still relatively fast and I'm sure my code can be optimized.
I'll try to merge my code with tuan's source update and see what results we can get. :wink:

- Sput

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 »

Zip is updated now and has a binary Demo.

Erode and ParticleDeposion are mainly filters to heightmaps generated with a fractal, fault or plasma method, and can be called multiples times on same mesh.

Gui addition is horrible hack... in code, because hand xml edition of positions is so...
here it is Sources and Binaries

innovati
Kobold
Posts: 35
Joined: Mon Feb 07, 2005 6:01 pm
Location: Ontario Canada
Contact:

platform independant source and more

Post by innovati »

Well, what if it was made so that the texture was generated based on the topography of the map? Also, could we get either a Linux binary or some source for that?

This looks to be something less i have to create for my game....

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 »

maplsplitter in ogreaddons paginglandscap tools does just that, generating texture or splatting textures based on topography. Just use code from there and put it in terrabuild !

Zip does contains source, you just have to create makefiles/configure to make it run under linux. (hint, copy the directory under the ogre samples directory and take makefile from on of the samples (demo_gui for instance))

User avatar
Sputnick
Greenskin
Posts: 110
Joined: Wed Sep 08, 2004 11:49 pm
Location: Lausanne, Switzerland

Post by Sputnick »

Finally, I found some time to add my contribution: Water Erosion.
My code can definitely be optimized and still has a little bug as some ridge elevation can be raised by the algorithm (this should never happen). So I've just fixed it by calling a bluring function once every a few iterations. But the resut is close to what can be expected:

Image
Full size image

In fact the algorithm is quite fast for small heightmap like that.

I forget to mention in the code that it is based on the following article:
"The Synthesis and Rendering of Eroded Fractal Terrain" by Kenton Musgrave.

Here is the demo and the source code:
http://www.goutte-d-eau.org/sputnick/og ... d_Sput.zip
Enjoy,

-Sput

User avatar
psyclonist
OGRE Expert User
OGRE Expert User
Posts: 286
Joined: Fri Nov 01, 2002 3:54 pm
Location: Berlin & Nuremberg, Germany
x 1
Contact:

Post by psyclonist »

Looking great! Looking forward to playing around with it!

-psy

User avatar
Wretched_Wyx
Orc
Posts: 498
Joined: Thu Mar 16, 2006 5:27 pm
Contact:

Post by Wretched_Wyx »

Wow, this is a damn fine tool! Just out of curiosity, where does it stand currently? I wouldn't mind seeing what kind of updates have been made...

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

It is integrated with the Paging Landscape Scene Editor now, IIRC. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

User avatar
danharibo
Minaton
Posts: 997
Joined: Sat Feb 25, 2006 8:14 pm
Location: Wales, United Kingdom
Contact:

Post by danharibo »

i would use plsm2, if it would BUILD!

Post Reply