Request: Passing IImage or ITexture as heightmaps

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
Wyg
Posts: 2
Joined: Wed Sep 02, 2009 1:20 pm

Request: Passing IImage or ITexture as heightmaps

Post by Wyg »

Just a quick feature request: it'd be nice if you could pass an ITexture or IImage to a terrain scene node as its heightmap instead of a file. I'm working on a procedural terrain engine, and this would certainly come in helpful :)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You should use loadHeightmapRAW, which has much better performance and can easily be used with a memory read file :)
Wyg
Posts: 2
Joined: Wed Sep 02, 2009 1:20 pm

Post by Wyg »

Doh!
Can't believe I missed that.
Thanks :)
larztheloser
Posts: 13
Joined: Thu Oct 08, 2009 8:58 pm
Location: New Zealand

Post by larztheloser »

I still think the suggestion has merit. Or at least the ability to convert a texture to a sort of virtual io::IReadFile.

What I have is a texture. Currently, as I understand it, it is not possible to convert that texture to a height map for a terrain without saving the file (hope I'm not missing something). If I didn't have to save the file the would be useful.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Doing it using textures is very sloppy, they exist in video RAM and the terrain vertices are not created there. Once we have HDR loader support it would be sensible to allow floating point (and standard) IImages though.

Please add this to the feature request tracker so we don't forget!
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
larztheloser
Posts: 13
Joined: Thu Oct 08, 2009 8:58 pm
Location: New Zealand

Post by larztheloser »

An IImage would do just as well (Just trying to do simple perlin noise random terrains).
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You don't need to save to a file, just copy it into an IImage and read the data (via memory read file) back as a RAW heightmap.
Post Reply