heightmap anomalies

Blitz3D Forums/Blitz3D Programming/heightmap anomalies

RGF(Posted 2009) [#1]
I am using a 256,256 greyscale image as a heightmap. All peripherical areas are black (0,0,0), but the terrain displays abnormal heights, just in the first row of the terrain matrix. The size of the bitmap is 256,256 exactly and I've checked all pixels are colored 0,0,0 in the borders. Why does this happen? Thanks!


Ross C(Posted 2009) [#2]
Can you post the heightmap image? Or email me it? Are you using a blitz terrain?

Also, are you saving the greyscale heightmap as a 24 bit bmp? Or something less?


RGF(Posted 2009) [#3]
sure! I'm using photoshop, 256*256, 24 bit bmp. I'm emaling you, thankyou!


Ross C(Posted 2009) [#4]
Ah, i believe this is an issue with it repeating from the other side. I mean, it's taking the very end height information from the other side of the image you supplied. I think the best way to solve this, is to put a pure black outline, on your terrain heightmap.


Ross C(Posted 2009) [#5]
Yep, confirmed. That sorts it. It's an odd problem. It may be related to blitz using an average of the surrounding pixels in the image, taking image information from the other side of the image.


RGF(Posted 2009) [#6]
ok, fine! Thanksalot!


RGF(Posted 2009) [#7]
Indeed, after testing various heightmaps, you are right. When a heightmap ends in a black area, the heights of the first row of vertexes are calculated taking the height of the last row of vertexes in the opposite side as a reference, promediating the height values. A good remark, that should be in loadterrain() official documentation.