RESOLVED: Float 16 textures do math wrong?

Hi there,

I’ve simplified a bug down to what I hope is a reproducible level. I have 2 TOP glsls and their format is float 16 rgba and when I try to add the r,g,b channels in this single pixel each is off by something close to 10. Here you can see that the b channel result is about 14 less than what 222+29164 would equal. Similar issue with the red channel 56320 + 141 != 56448

Almost always it is smaller than it is supposed to be and I can’t for the life of me figure out why this is happening. What I do know is that when I change the pixel format to rgba32 the addition works out. Is this me not understanding something about binary representations of numbers?

16-bit floats can only represent ±1024 perfectly. Anything beyond that is an approximation and subject to floating point roundoff.

oh gosh so to put it simply

Is this me not understanding something about binary representations of numbers?

Yuppers =D. Thanks for the help!