Page 1 of 1

Stichig Heightmaps

PostPosted: Tue Apr 30, 2019 3:13 pm
by ET_Gamer03
Ok i have gone ahead and taken Real world Terrain and imported it into l3dt (which works fine). The only problem is that they have to give the data to me in tiles (meaning i have to import them separately and stitch them together to make the full heigthmap after i have exported them). This means the terrain has varying highest and lowest points in each tile (or heightmap). Therefore when i got to export the heightmaps as images, the value of lets say (Black) could be 650m in one image and 800m in another. This "dominoes" through the rest of the grayscale, meaning that white in one is 1000m and 1150m respectively.

Untitled.png
This is what happens.


Desktop Screenshot 2019.04.30 - 15.23.46.76.png
and in 3d


Is there a way to make the height/value of a Grayscale colour the same over more than one heightmap?

Elliott

Re: Stichig Heightmaps

PostPosted: Thu May 09, 2019 9:13 pm
by Czorio
If you know the lowest height and the heighest height of all your images, you can normalize the values of the pixels with

Code: Select all
result = (Pixel Value - Minimum Value) / (Maximum Value - Minimum Value)


This should result in floating point values between 0 and 1, which you can then scale back to desired heights using

Code: Select all
result = Normalized Pixel Value * (Maximum Value - Minimum Value) + Minimum Value


Of course, this is assuming that the pixel values in your image are not simply [0, 255], but the actual heights of the terrain at that point.