You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i think there is a problem in your article "Encoding normalized floats to RGBA8 vectors".
For example, there is a float number 0.545, and run packFloatToVec4i will get the vec4 [0.7200000006705523, 0.1171875, 0.51953125, 0.54296875], then multiply vec4 by 255.0 can get the [183.60000017099082, 29.8828125, 132.48046875, 138.45703125] according to this article, finally, the color will round to integer and the error is introduced.
At last we will get the wrong float number when run unpackFloatFromVec4i in shader. So, the divisor should be 255.0.
The text was updated successfully, but these errors were encountered:
Hi, i think there is a problem in your article "Encoding normalized floats to RGBA8 vectors".
For example, there is a float number
0.545
, and runpackFloatToVec4i
will get the vec4[0.7200000006705523, 0.1171875, 0.51953125, 0.54296875]
, then multiply vec4 by 255.0 can get the[183.60000017099082, 29.8828125, 132.48046875, 138.45703125]
according to this article, finally, the color will round to integer and the error is introduced.At last we will get the wrong float number when run
unpackFloatFromVec4i
in shader. So, the divisor should be 255.0.The text was updated successfully, but these errors were encountered: