Page 1 of 1

Potential problems with big coordinates

Posted: Wed Feb 02, 2011 3:38 pm
by SamJ
I have a large procedural world and I've noticed that when I get very far from the origin point (like 1,000,000 units) seams start to appear between the terrain chunks. This is due to the unprecision of the float type I suppose and I'm confident the problem will be gone as soon as I rebuild Ogre with double precision.

But this got me thinking, are there any other issues with big coordinates? For example, since the GPU uses floating point, should I expect some inconsistencies with shaders when using big coordinates? Are there other side effects?

If there are problems, the obvious solution would be to keep the camera at the origin and move the world instead, but could this affect performance negatively? In other words, should it be faster to move the camera than to move the whole world or is Ogre totally relativistic in this sense and it doesn't care?

Sorry for the vague questions but I would like to settle whether to make the terrain static or sliding before my code gets more complex.

Re: Potential problems with big coordinates

Posted: Wed Feb 02, 2011 3:48 pm
by jacmoe
/* moved to Help */
Try this topic:
http://www.ogre3d.org/forums/viewtopic.php?f=2&t=58542 :wink:

Re: Potential problems with big coordinates

Posted: Wed Feb 02, 2011 3:57 pm
by so0os
I'd use ints for such matter, but i suppose it might not be a good advice as well.