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.
Potential problems with big coordinates
-
- Halfling
- Posts: 40
- Joined: Tue Jan 25, 2011 9:12 pm
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: Potential problems with big coordinates
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- so0os
- Bugbear
- Posts: 833
- Joined: Thu Apr 15, 2010 7:42 am
- Location: Poznan, Poland
- x 33
Re: Potential problems with big coordinates
I'd use ints for such matter, but i suppose it might not be a good advice as well.
Sos Sosowski
http://www.sos.gd
http://www.sos.gd