Potential problems with big coordinates

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

Potential problems with big coordinates

Post by SamJ » Wed Feb 02, 2011 3:38 pm

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.
0 x

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

Re: Potential problems with big coordinates

Post by jacmoe » Wed Feb 02, 2011 3:48 pm

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

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

Re: Potential problems with big coordinates

Post by so0os » Wed Feb 02, 2011 3:57 pm

I'd use ints for such matter, but i suppose it might not be a good advice as well.
0 x
Sos Sosowski :)
http://www.sos.gd

Post Reply