Terrain Heightmap Questions

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
lucifer1101
Posts: 42
Joined: Sun Nov 16, 2008 11:23 pm
Location: Melbourne, Australia
Contact:

Terrain Heightmap Questions

Post by lucifer1101 »

Hello all i have a few questions about the heightmaps for irrlicht..

After doing the terrain example i was looking to swap the heightmap for the one i have, but when i tried to launch it i got some access violations i believe..

It may have been caused by the size and/or the format, so what i want to know is

*What is the maximum size for a heghtmap in irrlicht?
*and what format should it be in....
Valmond
Posts: 308
Joined: Thu Apr 12, 2007 3:26 pm

Post by Valmond »

You can use a 256 color grayscale image AFAIK.

I'm using a 32bits .raw 512*512 image wich works well.


Guess you should use a square image with the size power of two (64x64 , 128x128 , 256x256,...) also...
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Valmond wrote:Guess you should use a square image with the size power of two (64x64 , 128x128 , 256x256,...) also...
it must not be a square, but it must have dimensions with POT+1 (65, 129, 257, ...) !!! ;)
also the heightmap must not be too big, the buffer holds only an u16 amount of vertices...
well, the latter should be solved in the last release (u32 buffer) so you could use larger heightmaps as well, but I don't know how well this works... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The standard heightmap uses a grey image (256 colors in a supported image format). But you can generate an empty terrain scene node and call the raw map loader, where you can also pass some parameters to get the proper encoding for your heightmap (int/float and byte count). The dimensions should be 2^n+1 as Acki said, in order to simplify the work of the LOD system and get proper texturing, although some of those errors have also been resolved in 1.5
Post Reply