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.
kidhr
Posts: 9
Joined: Fri Oct 01, 2010 5:04 pm

Post by kidhr »

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

Could you send me your modified irrlicht.lib file ?

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

Post by Valmond »

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

Post by kidhr »

Solved :)

Sorry

I've change this option in IrrCompileConfig
#define _IRR_MATERIAL_MAX_TEXTURES_ 4
to
#define _IRR_MATERIAL_MAX_TEXTURES_ 8

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

Thanks :wink:
grumpymonkey
Posts: 222
Joined: Mon Jan 19, 2009 10:03 pm
Location: Miami, Florida
Contact:

Post by grumpymonkey »

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
Image
Saumane
Posts: 27
Joined: Wed Jul 09, 2008 6:14 pm
Location: Finland

Post by Saumane »

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
Valmond
Posts: 308
Joined: Thu Apr 12, 2007 3:26 pm

Post by Valmond »

@kidhr

Oh yeah good working, totally forgot about that one!


@grumpymonkey

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


@Saumane

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.
kklouzal
Posts: 343
Joined: Sun Mar 28, 2010 8:14 pm
Location: USA - Arizona

Re: Simple Terrain Class

Post by kklouzal »

This is awesome!
Although I'm having a small problem..
It compiles fine but I get this in the console

Code: Select all

HLSL pixel shader compilation failed:
(113): error X3500: asymetric returns from if statements not yet implemented
 
ShaderNumber=-1
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.
Katsankat
Posts: 178
Joined: Sun Mar 12, 2006 4:15 am
Contact:

Re: Simple Terrain Class

Post by Katsankat »

Hello, would you help to get it textured with OpenGL?
Here is my code :

Code: Select all

 
        if(choice=='1')
        {
                //use the new terrain:
 
                SimpleTerrain =
                        new SimpleHeightMap(smgr, smgr->getRootSceneNode(), 0, "heightmap32bit00-00.raw",core::vector3df(0,0,0),core::vector3df(0,0,0),
                        core::vector3df(800.0f,800.0f,800.0f));
 
                //SimpleTerrain->setMaterialType((video::E_MATERIAL_TYPE)ShaderNumber);
                //SetTextures(SimpleTerrain->getMaterial(0));
 
                SimpleTerrain->setMaterialType(video::EMT_SOLID);
 
                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);
        }
 
Post Reply