Closed nvkelso closed 8 years ago
@zerebubuth and @blair1618 should confirm that this is what we discussed to make sure I remembered properly :) (And same for normals maps, assume in different issue)
I've updated the title of this, as I was confused: When I read "16-bit PNG" the first thing I think of is 16-bit channels, but that wasn't what was meant.
Additionally: We discussed using 2 channels for the moment, but leaving the 3rd as a fractional channel for future use. It turns out that NED has fractional heights, so we can start using that now. I propose that we do the following:
uheight = height + 16384.0
[r, g, b] = [int(uheight) >> 8, int(uheight) & 255, int(frac(uheight) * 256]
Does that sound like it'll work well enough, shader-side?
Yes, sounds good. So it's 24-bits of precision, in a fixed-point 16.8 format (16 bits of integer, 8 bits of fraction).
Yeah, makes sense to me!
float height = (texel.r * 256.0 + texel.g + texel.b / 256.0) - 16384.0;
Oops, that should have been:
uheight = height + 32768
Although I'm not sure it would have mattered; Challenger Deep is only 10,916m, so we've got a bit to spare :wink:
Team Tangram has requested raw 16-bit elevations, as a 2-channel PNG (two channels of 8 bits each).
/cc @bcamper @blair1618