heightmap anomalies
Blitz3D Forums/Blitz3D Programming/heightmap anomalies
| ||
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! |
| ||
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? |
| ||
sure! I'm using photoshop, 256*256, 24 bit bmp. I'm emaling you, thankyou! |
| ||
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. |
| ||
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. |
| ||
ok, fine! Thanksalot! |
| ||
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. |