It should work to use lower resolution for the exponent. I am not shure about the artifacs, but is should only be noticeable in high contrast edges. [snapback]21034[/snapback]
Actually I do the RGBE encoding with the following code:
int encode(float r, float g, float b,
const float maxComponent = max(max(r, g), b);
const int exp = (int)ceilf(log2f(maxComponent));
const float divisor = powf(2.0f, exp);
encodedR = r / divisor;
encodedG = g / divisor;
encodedB = b / divisor;
So: r = encodedR * 2\\^exp, g = encodedG * 2\\^exp and b = encodedB * 2\\^exp;
I found that it works better if I return exp * 16 (instead of exp), but in high contrast edge some Halo effects appear.
Anyway, I dunno if is convenient to do bilinear filtering manually in the pixel shader...
This sound too nasty and slow... :dry:
The following image is a shot from my editor. I use RGBE normally (without multiply by 16):
The following is with the exponent multiplication:
The last show halo and artifacts (again with multiplication by 16):
Exponent is clipped to stay in the range [-8, 7] when multiplied by 16. So it lie in the range [-128, 112]. I also sum 128 to remove the sign ([0, 240]). So it can stay in a single byte. Yes, dynamic range is less than previous, but images look really better.
I don't understand the nature of the artifacts, at all. Halo should be due to bilinear filtering. The problem is that filtering should happen AFTER decoding and not before.
Is this what you mean for "use lower resolution for exponent"?