Potential problems with big coordinates

Problems building or running the engine, queries about how to use features etc.
Post Reply
Posts: 40
Joined: Tue Jan 25, 2011 9:12 pm

Potential problems with big coordinates

Post 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.

User avatar
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Re: Potential problems with big coordinates

Post by jacmoe »

/* moved to Help */
Try this topic:
http://www.ogre3d.org/forums/viewtopic.php?f=2&t=58542 :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

User avatar
Posts: 833
Joined: Thu Apr 15, 2010 7:42 am
Location: Poznan, Poland
x 33

Re: Potential problems with big coordinates

Post by so0os »

I'd use ints for such matter, but i suppose it might not be a good advice as well.
Sos Sosowski :)

Post Reply