floatToRgbe seems doesn't work
bbbbx opened this issue · comments
floatToRgbe seems doesn't work for some float point number.
for example:
const rgbe = floatToRgbe(new Float32Array([0.5, 0.5, 0.5])); // [0, 0, 0, 127]
// result should be [128, 128, 128, 128]
// convert back: failed
const float = rgbeToFloat(rgbe); // [0, 0, 0]
// use correct rgbe
rgbeToFloat(new Uint8Array([128, 128, 128, 128])); // [0.5, 0.5, 0.5]