Terrain Heightmap

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
Zharramadar
Posts: 11
Joined: Mon Sep 18, 2006 12:03 am

Terrain Heightmap

Post by Zharramadar »

Hi ppl

I made a 1024x1024 heightmap, and I added it in place of the terrain loaded with the terrain tutorial, found in the website, but I found out it scrambled my terrain totally.

Searching the forum, I found out this is a known problem.

What I want to know is if, currently, there's a way to use heightmaps bigger than 256x256, or if not, what I must do in order to change the engine or something else in order to use it.

I'm not willing to use heightmaps smaller than 1024x1024 and I really want to keep on with Irrlicht, it is a very good and simple to use engine.

Thanks guys, see you.
jam
Posts: 409
Joined: Fri Nov 04, 2005 3:52 am

Post by jam »

To use heightmaps that are >256 you need to patch Irrlicht to use 32bits for the vertices.
Hybrid I think has this patch here

Or I think the SVN version of Irrlicht has the patch already applied if I remember correctly. Someone with greater knowledge of the changes done in the SVN might be able help you.
system-independent, adj.:
Works equally poorly on all systems.
-- unknown
hybrid
Admin
Posts: 14144
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, SVN has not applied the patch, and there's also no patch for 1.1 (due to the large number of changes applied meanwhile). Either use 129x129 (256 sizes don't work correctly) or develop your own solutions - that's currently the only thing you can do.
Zharramadar
Posts: 11
Joined: Mon Sep 18, 2006 12:03 am

Post by Zharramadar »

Very well, let's rock then!

Irrlicht sourcecode, here I go ... :)

I just wonder why this fix wasn't put in the officil development version, it's a shame to Irrlicht to still have 16bit indexes and only <256x256 heightmaps!

Thanks for the help, ppl.
hybrid
Admin
Posts: 14144
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

16bit indices are sometimes really good. And the patch I had (an early one from IrrSpintz) did not contain the IIndexBuffer interface. So it was really just as incomplete as before. It would be better if the terrain code would use several mesh buffers instead of just one. That would overcome the limit and work with all Irrlicht versions.
Zharramadar
Posts: 11
Joined: Mon Sep 18, 2006 12:03 am

Post by Zharramadar »

Perhaps, when I get more familiarized with the source, I can play with the engine helping you guys improve it... It would be very nice if some more experienced soul could add this to the engine, then, as it would be a great contribution.

I'm downloading the DirectX SDK now so I can have DX headers in order to compile Irrlicht....

Anyway, thank you for showing me the way I needed to follow.
Ico
Posts: 289
Joined: Tue Aug 22, 2006 11:35 pm

Post by Ico »

This remembers me of some sample code I've read here somewhere concerning "clipped" textures. You load a big texture and then define the area to use as the "effective texture". Sorry too late and too lazy to go searching noch. ;)

What do you think about this:
1. Load your whole terrain texture (like 2048x2048 or something else) into one of those "customizable" textures.
2. Define the area where the camera/player is located at the moment as the part of the texture to be used for rendering.
3. Create an height map with this texture part.
4. Save the camera's/player's position.
5. Once the character/camera has been moved X units away from the saved position jump back to step 2.

Depending on the size of your clipped texture and map complexity... I'd say this should work. :) At least as long as you don't want any texture splats etc. but I think those could be done, too.
Post Reply