The saga continues! In short, I need to pack a floating point number in [0..1) range into several channels of 8 bit/channel render texture. My previous approach is not ideal.
Turns out some folks have figured out an approach that finally seems to work.
Here it is for my own reference:
Suggestion right there on my previous blog post comments
Repost gamerendering blog
Repost on gamedev.net forums again.
So here’s the proper way:
1 2 3 4 5 6 7 8 9 | |
That is, the difference from the previous approach is that the “magic” (read: hardware dependent) bias is replaced with subtracting next component’s encoded value from the previous component’s encoded value.