Quote:Original post by Christer Ericson
Quote:Original post by Charles B
If the solution that mixes integers (or fixed points) for world coords and floating points for vectors works, then biasing the floats achieves exactly the same result, with more convenience and perfs because only floats are used.
Nonsense. The range and precision of the two systems are greatly different, so biasing of floats most certainly does not achieve exactly the same result.
I meant algorithmically, not in terms of absolute metric range/precision. My sentence could be confusing, I admit. Of course 32 bits biased floats have a 23 bits mantissa. But you can also use 64 bits biased floats that is 52bits of mantissa, far enough to cover the needs of any planetary God in a 3D game. Doubles and floats work hands in hands in the CPU and with the GPU, whereas 64 bits integers don't, require conversions, if you want to compare comprable things.
I mentionned all these things numerous times in this thread.
What limitates is usually not the metric range/precision of the world coords. If your 3D API manipulates 32bits floating points internally, using 64 bits integers changes nothing. In anyway, at one moment your 64bits integers will be converted to floating points. Either you do some relative to camera stuff yourself (fine but slower) and reduce the number of bits or else your input coords will in fact be
rounded (the 12 lower bits dropped) to 52bits of mantissa doubles (or even 23 bits mantissa floats). At the very best you can hope that the 3D API takes 64bits integers and the transfo are well coded so that intermediates fit in 80bits floating point registers. Then there is really no significant loss. But there is no easy way to be sure of it, to my knowledge.
So what's the point in using 64 bits integers since it will be slower, clumsier to code and not more accurate than doubles ? Ah they are discretized (of homogenous precision) ! OK here we are.
I hope you followed me in the technical details here. Or maybe I missed something about the 64bits integer solution.
And then what counts is the variation in magnitude of the coords. If you mix near zero coords and bigger coords you'll have some problems. If you cross various 2^n boundaries, you get different precision losses. For instance if two objects follow different transfo paths, common vertices (junctions) might collapse and create visible cracks (black pixels).
So back to 32bits biased floats, it's as if one used 23 bits integers. And 23 bits are enough to map 8kms with 1mm precision, or 80kms for 1cm precision. Which already starts to make a big scene, and enough precision for terrain vertices.
By claiming non sense so quickly, I am not certain you fully understood what the fact that coords are
discretized potentially brings in terms of numerical and graphical stability.
To sum it all up : "discretizing is forcing to less
precision to render more
accurately". ;)
Just in case I repeat :
"This reduces the number of low order bits and thus reduces dropped bits, that is precision losses."
I also said I can detail the issue in many contexts (whether one uses local coords or monolithic world coords, depending on the 3D hardware or driver implementation, etc...), if anyone is interested. I am less interested loosing time into nonsense polemics or qui proquos (partially my fault then). I hope it's not all nonsense ;)
[Edited by - Charles B on February 23, 2005 8:01:59 AM]