Resolution of a float for a color vector
-
Hi Folks!
If I got it correctly a color in F4NS is represented by a vector with 4 values (r,g,b,a) and every value is ranging from 0 to 1, right? So what's the supported resolution for this values? Does it even take 0.0039215686274509803921568627451 (1/255)?
Of course this is just a pretty extreme example.Thanks in advance!
-
@Bl4ckM4ch1n3 It doesn't matter much to store 1/255 in this context, since there are are 256 steps in each 8-bit rgba value.
EDIT - it seems like it has enough accuracy to store 1/256 accurately:
a = 1/256 print (a, "\n") a += 0.00000025 a += 0.00000025 a += 0.00000025 a += 0.00000025 print (a, "\n")
Gives this result:
0.003906
0.003907 -
@Nisse5 said in Resolution of a float for a color vector:
It doesn't matter much to store 1/255 in this context, since there are are 256 steps in each 8-bit rgba value
Of course, I'm such an Idiot :facepalm:
That happens when you're coding in a hurry! lolI assume F4NS will cut floats after the sixth digit after "0.", so I'll cut my generated values after the sixth digit aswell.
Thank you very much!