This adds normal maps as a 3rd type of output. Currently it shares a lot of code with the Terrarium tiles, but hopefully we can factor that out in the future.
This is what the tiles look like:
That's the RGB channels on the left and alpha as greyscale on the right, to make it easier to see. With R, G, B, A = X, Y, Z, H where X, Y, Z are the respective components of the normal, scaled with (-1.0, 1.0) mapped to (0, 255) with 0.0 mapped to 128. The A = H component is mapped to a table having:
-11,000m to -1,000m in 1,000m increments,
-100m, -50m, -20m, -10m, -1m,
0m to 3,000m in 20m increments,
3,000m to 6,000m in 50m increments,
6,000m to 8,800m in 100m increments.
Note that the indices count from 255 (for -11,000m) down to 0 for 8,800m. This is so that the more common heights near sea level have more opaque alpha values suitable for viewing in a web browser.
This adds normal maps as a 3rd type of output. Currently it shares a lot of code with the Terrarium tiles, but hopefully we can factor that out in the future.
This is what the tiles look like:
That's the RGB channels on the left and alpha as greyscale on the right, to make it easier to see. With R, G, B, A = X, Y, Z, H where X, Y, Z are the respective components of the normal, scaled with (-1.0, 1.0) mapped to (0, 255) with 0.0 mapped to 128. The A = H component is mapped to a table having:
Note that the indices count from 255 (for -11,000m) down to 0 for 8,800m. This is so that the more common heights near sea level have more opaque alpha values suitable for viewing in a web browser.
Connects to #31.
@rmarianski could you review, please?