Hi,
I want to load the texture completely in the terrain, without cutting or repeating it. Since each texture is a country, what I do is:
1) cut a world altitude map for the country region (this creates a small bmp, which is loaded with smgr->addTerrainSceneNode);
1.1) this map has to be scaled to meet the aspect ratio of the country. The scale parameter of addTerrainSceneNode then is:
core::vector3df(ScaleH*dimPais.Width/dimPais.Height, ScaleV, ScaleH),
where dimPais contains the width and height of the altitude map for that country.
2) load the vegetation map for the country (an existing png file for each country);
Some examples:
Honduras (altitude map: 93x51 pixels; vegetation map: 696x386)
Germany (altitude map: 137x116 pixels; vegetation map 1027x872)
I had to use
terr->scaleTexture(1.15f,1.f); // for Honduras
and
terr->scaleTexture(1.062f,1.f); // for Germany
for the textures display correctly (without cutting).
Irrlicht 1.5 still has the 2^n+1 necessary size of the texture (or heightmap)?
Can anyone tell me what is going on, please?
I don't want my texture cut!
-
- Posts: 24
- Joined: Mon May 25, 2009 2:18 pm
- Location: Brazil
- Contact:
I don't want my texture cut!
I feel, therefore I am.
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
I guess that you don't necessarily need the DLOD feature of the terrain scene node, so you could switch to the terrain mesh which does not require the 2^n+1 dims (it's only necessary for this feature, though also the textures can break when using different dims). Due to the upscaling when using NPOT textures it should be much easier to align POT textures.