Heightmap "HD" Textures?

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
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Heightmap "HD" Textures?

Post by LunaRebirth »

Hello!
Sorry again for my noob-like posts.

I've created a... Rather large heightmap terrain.
Using this code:

Code: Select all

terrain = smgr->addTerrainSceneNode(
    "Media/terrain-heightmap.bmp",
    0, -1,
    core::vector3df(0.f, 0.f, 0.f), 
    core::vector3df(0.f, 0.f, 0.f),
    core::vector3df(80.f, 65.0f, 80.f),
    video::SColor ( 255, 255, 255, 255 ),
    1, scene::ETPS_17, 4);
 
terrain->setMaterialFlag(video::EMF_LIGHTING, false);
 
terrain->setMaterialTexture(0,
     driver->getTexture("Media/terrain-texture.jpg"));
terrain->setMaterialTexture(1,
     driver->getTexture("Media/terrain-texture2.jpg"));
 
terrain->setMaterialType(video::EMT_DETAIL_MAP);
http://imgur.com/35vpbqU As you can see, it's rather blotchy, and not as good as it should look.
I also can't seem to add shadings to the heightmap, making for darkness like day/night effects.
I'm assuming you cannot add that stuff to heightmaps, and I need to make a mesh for it? Which I don't really want to do.

Heightmap Size: 512x512
Texture1&2 Size: 3084x3084
(Textures are much bigger than the heightmap, and still it looks like each pixel tries to blend into the next pixel color a lot, making it look bad)
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Heightmap "HD" Textures?

Post by hendu »

So a terrain of 40960 x 40960 (512 * 80) meters has 3084 pixels for all of it - one pixel for every 13.28 meters ;)

You'd want to tile that texture perhaps. For shading, if you do that in the pixel shader it'll be fine - the fixed function works on per-vertex basis, and your verts are 80 meters apart.
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Re: Heightmap "HD" Textures?

Post by LunaRebirth »

How do you suppose I tile it? I know that you can reduce the texture size of the heightmap so the texture loads a sort of "copy and paste" into multiple parts of the map. But if, for example, I only want a dirt spot on a certain part of the map, that would also copy and paste like the rest of the map?
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

Re: Heightmap "HD" Textures?

Post by Seven »

search for triplaner in the forums. There is a nice shader that allows you to use 6 textures and it minimizes the distortion that you get when texturing heightmaps.
Post Reply