Re: Question about large worlds and foating point precision.
"Gregory Junker" <[email protected]> Tue, 21 Jun 2011 20:41:26 -0700
| Newsgroups | gmane.games.devel.sweng |
|---|---|
| Message-ID | <099901cc308e$44273050$cc7590f0$@com> |
It's most often solved by transforming the origin. Increasing precision is *not* the answer; it simply delays the inevitable a little longer (while at the same time halving your VPU throughput). Of course, at the last second, you might be able to do intermediate host computations in increased precision, but at the end of the day, your graphics hardware is rendering with 32-bit floats (at most). This is a well-known problem with well-understood solutions in practice. That said, you can't just use (for example) the GPG4 solution in one system, without your entire game engine using it. So "messy" is a relative term; if you are developing a large-world game, chances are you are using a large-world game engine. If not, you've probably licensed the wrong engine for your game. Floating-point precision issues are also well-defined (from a computer science perspective), but often not really fully understood by most programmers (myself included). The most commonly cited work is David Goldberg's paper for ACM (1991). An edited version is here: http://www.cse.msu.edu/~cse320/Documents/FloatingPoint.pdf The original is here: http://portal.acm.org/citation.cfm?id=103163 Greg From: [email protected] [mailto:[email protected]] On Behalf Of Juan Linietsky Sent: Tuesday, June 21, 2011 8:12 PM To: [email protected] Subject: [Sweng-Gamedev] Question about large worlds and foating point precision. Here's a doubt i've been having for a while. When developing games based on large worlds (like Elder Scrolls, GTA, etc), i can imagine that physics and rendering become more jittery the further away the camera moves from the origin (due to floating point precision loss). Is this really a problem? If so, how is this solved? I can imagine that increasing floating point precision to doubles helps a enormously, but i'm not sure if that's enough and if it's worth the extra processing/bandwidth cost. Transforming the world to local coordinates (so the camera is always at the origin) also seems to me like a solution, but sounds like a lot more work and messy code. So, how is this solved in most cases? cheers! Juan _______________________________________________ Sweng-Gamedev mailing list [email protected] http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com