Alrighty, first let me say, yes I know that tutorial 23 shows how to make a custom heightmap.
My question is, is there any benefit to doing it this way, rather than deriving a new SceneNode and creating the geometry manually?
I've done a bit of forum searching and it seems that when someone wants to create their own geometry, they are pointed towards tutorial 23. I've tried it out, and it confused the heck out me. On the other hand, creating a simple heightmap out of a Custom Scene Node seems relatively simple.
So yea... i was just wondering if there would be any significant benefit if I put in the extra time to try and figure out what is going on in tutorial 23?
Thanks a lot!
Creating a custom heightmap (?)
-
- Posts: 126
- Joined: Sun Apr 02, 2006 1:21 am
- Location: Canada
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
If you derive a new scene node (as in example 3, custom scene node), you need to do that part as well as what is shown in example 23. So you won't win anything from using a custom scene node. Moreover, you lose the ability to use hardware buffers, which causes your meshes to be much slower in rendering. That's why it is suggested to use a manually defined mesh all the time, instead of using a custom scene node. Custom scene nodes are only required if you want to alter the default way of rendering geometry.
However, custom heightmap is a very different thing. Heightmaps are just 2d images containing the height information in some way stored in their pixel colors. They are then used with the terrain mesh or terrain scene node to create the terrain geometry. This does not need any manual interation at all, you just load in the heightmap.
However, custom heightmap is a very different thing. Heightmaps are just 2d images containing the height information in some way stored in their pixel colors. They are then used with the terrain mesh or terrain scene node to create the terrain geometry. This does not need any manual interation at all, you just load in the heightmap.
-
- Posts: 126
- Joined: Sun Apr 02, 2006 1:21 am
- Location: Canada
Thanks for your responses.
I realize that there is a TerrainSceneNode with which I could use a height map. This isn't suitable for my needs. Basically, I want to replicate what the TerrainSceneNode does, but I have a few things that I need to alter in the process. I'm not worried about LOD'ing it right now, so that isn't really a concern. If I could just figure out how to create a basic height map generated mesh, I'd be happy.
I've never done any mesh generation though, I've always used modelling programs or the built in scene nodes, such as the cubeSceneNode.
From what I can gather then, it's best if I put a bit of time in to figuring out what is going on in example 23?
Edit: It just occurred to me that Irrlicht is Open Source, so since I'm basically trying to make a simpler version of the ITerrainSceneNode, I decided I should take a look at how it is implemented. I'm going to start reading there, I think
I realize that there is a TerrainSceneNode with which I could use a height map. This isn't suitable for my needs. Basically, I want to replicate what the TerrainSceneNode does, but I have a few things that I need to alter in the process. I'm not worried about LOD'ing it right now, so that isn't really a concern. If I could just figure out how to create a basic height map generated mesh, I'd be happy.
I've never done any mesh generation though, I've always used modelling programs or the built in scene nodes, such as the cubeSceneNode.
From what I can gather then, it's best if I put a bit of time in to figuring out what is going on in example 23?
Edit: It just occurred to me that Irrlicht is Open Source, so since I'm basically trying to make a simpler version of the ITerrainSceneNode, I decided I should take a look at how it is implemented. I'm going to start reading there, I think
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
If you don't need LOD you can use the terrain mesh. smgr->getGeometryCreator()->createTerrainMesh(video::IImage* texture,
video::IImage* heightmap,
const core::dimension2d<f32>& stretchSize,
f32 maxHeight, video::IVideoDriver* driver,
const core::dimension2d<u32>& defaultVertexBlockSize,
bool debugBorders=false) const =0;
Pass in the heightmap as second parameter (first texture is diffuse map). This will automagically create the meshes from your heightmap. Supports arbitrary image sizes etc.
video::IImage* heightmap,
const core::dimension2d<f32>& stretchSize,
f32 maxHeight, video::IVideoDriver* driver,
const core::dimension2d<u32>& defaultVertexBlockSize,
bool debugBorders=false) const =0;
Pass in the heightmap as second parameter (first texture is diffuse map). This will automagically create the meshes from your heightmap. Supports arbitrary image sizes etc.
-
- Posts: 126
- Joined: Sun Apr 02, 2006 1:21 am
- Location: Canada
-
- Posts: 126
- Joined: Sun Apr 02, 2006 1:21 am
- Location: Canada