Game Development Community

Bitmap terrain -low contrast heightmap

by Mike Kloeppner · in Torque Game Engine · 10/01/2008 (11:30 pm) · 3 replies

For some reason TGE is taking my very very very low contrast heightmap (256sq png) and making very very high contrast. I can't find anything wrong with png.

#1
10/02/2008 (2:29 am)
Not sure exactly what you mean but you may try blurring the image to "soften" and round things off if that is the problem.
#2
10/02/2008 (9:27 am)
@Mike: Probably better to post an image of the heightfield and a screenshot of what it looks like in game. A few things to consider as well: Blurring or softening, as SilentMike suggested, and also the height range of the terrain, which you can use to cap the highest parts of the terrain. I can only speculate, but it could be that TGE is mapping your relatively close values to much further apart terrain altitudes, and this might help.
#3
10/03/2008 (4:42 pm)
Problem resolved :D Thanks Ted, you was right. It seems that when torque calculates the highs and lows of a heightmap, it does so based the highest 'high' and the lowest 'low' of the respective bitmap and not by any predetermined values in the engine. so if your using a really low contrast image like I am, your low might have a value of like (0.014,0.014,0.014) and your highest might only be at (0.028,0.028,0.028)
Looks like my problem was that torque would consider '0.014' as being pure white and '0.028' as being pure black.

To address this, i simply added a very small 100% white dot, as well as a small black to in an insignificant area of the heightmap. Looks like a functional heightmap must have at least 1 pixel of 100% white and another of black.


hope this helps someone else too

-mike