Simple Terrain Class

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.

Postby kidhr » Sat Oct 02, 2010 9:32 am

Yes it works fine with your exe and irrlicht dll :)

Could you send me your modified irrlicht.lib file ?

Posts: 9
Joined: Fri Oct 01, 2010 5:04 pm

Postby Valmond » Sat Oct 02, 2010 10:23 am

Posts: 308
Joined: Thu Apr 12, 2007 3:26 pm

Postby kidhr » Sat Oct 02, 2010 12:55 pm

Solved :)


I've change this option in IrrCompileConfig

It's working like a charm 4000 FPS !!!

Thanks :wink:
Posts: 9
Joined: Fri Oct 01, 2010 5:04 pm

Postby grumpymonkey » Sat Oct 02, 2010 1:29 pm

wow this is great, with the old terrain I peaked at 616FPS, with your new one I got to 4656FPS(with the camera facing the terrain, w/o 6k+)! I did find that it made my grapics card 'scream'. The fan got louder than usual and started making some squeaking noise O.o Might just be cause my fan sucks. My gfx card is an ati 4870 with 512mb DDR5

anyways thanks for this, its really useful
User avatar
Posts: 222
Joined: Mon Jan 19, 2009 10:03 pm
Location: Miami, Florida

Postby Saumane » Sat Oct 02, 2010 1:41 pm

Valmond wrote:I generate it with a script (just flushes all the floats into a file) and the data comes from Unity3D which I use to model my terrains.

That sounds interesting.. Is it also possible to export the terrain painting done in Unity? The splatting images i mean
Posts: 27
Joined: Wed Jul 09, 2008 6:14 pm
Location: Finland

Postby Valmond » Sun Oct 03, 2010 10:13 am


Oh yeah good working, totally forgot about that one!


Yeah it gets a bit like a Burn-Test with the GPU @ 100% :p (Use at own risk! ;-))


Sure, Here are my Unity scripts I wrote for terrains,
hopefully enough of them to export heightmap and splatmap.
I think maybe the heightmap must be 257*257 but that shouldn't be hard to change.
The heightmap resolution I'm uysing are (Do [Terrain]->[Set Resolution...]):
Terrain width 20480
Terrain Height 20480
Terrain length 20480
Heightmap resolution 257
Detail resolution 1024
Controle texture resolution 1024
Base texture resolution 1024

Put the files in the "basefolder"\UnityProject\Assets\Editor\ folder
Make a "basefolder"\Map folder
and leave room in the base folder for exports

Something along those lines anyway if you want to use the scripts out of the box.
Posts: 308
Joined: Thu Apr 12, 2007 3:26 pm

Re: Simple Terrain Class

Postby kklouzal » Tue Jul 19, 2011 5:30 am

This is awesome!
Although I'm having a small problem..
It compiles fine but I get this in the console
cpp Code: Select all
HLSL pixel shader compilation failed:
(113): error X3500: asymetric returns from if statements not yet implemented

The game compiles and I have a terrain but the texture is mostly black with some red, green, and blue splots all over.

It doesn't appear as if the texture files for the material are being set properly, the console shows it to load the files, but the material never gets them?? probably because the shader didn't load??

any ideas???
Dream Big Or Go Home.
Help Me Help You.
User avatar
Posts: 343
Joined: Sun Mar 28, 2010 8:14 pm
Location: USA - Arizona

Re: Simple Terrain Class

Postby Katsankat » Sat Dec 24, 2011 12:09 am

Hello, would you help to get it textured with OpenGL?
Here is my code :
cpp Code: Select all
                //use the new terrain:
                SimpleTerrain =
                        new SimpleHeightMap(smgr, smgr->getRootSceneNode(), 0, "heightmap32bit00-00.raw",core::vector3df(0,0,0),core::vector3df(0,0,0),
                video::SMaterial material = SimpleTerrain->getMaterial(0);
                        material.TextureLayer[0].Texture = driver->getTexture("Map/sand.jpg");
                        material.Lighting  = false;
                        material.EmissiveColor = video::SColor(255, 240,200,150);
                        material.SpecularColor = video::SColor(255, 223,231,100);
Posts: 178
Joined: Sun Mar 12, 2006 4:15 am


Return to Code Snippets

Who is online

Users browsing this forum: No registered users and 1 guest