Floating origin

3D rendering technique From Wikipedia, the free encyclopedia

Floating origin is a 3D rendering technique used primarily in video game graphics, where the virtual camera is used as a coordinate origin instead of it being a predefined point usually located in the center of the virtual scene. Instead of moving the camera to change the shot, the entire scene is shifted while the camera always stays at the origin. An alternative method called origin shift snaps the world and camera to the coordinate origin after moving the camera a specific distance away from the origin. These methods are typically used in 3D video games with large or procedurally infinite worlds to avoid rendering glitches caused by precision loss in floating-point arithmetic when moving the camera or player far away from the origin.

Reasoning

The vast majority of 3D games use floating points to represent coordinates, which has the advantage of accurately representing the world near its origin; however, the accuracy halves for every power of two units away from the origin.[1] With the single-precision floating-point format (32-bit IEEE 754), the accuracy reduces enough to not calculate fractions after 8,388,608 units. As accuracy gets lower further away, integer coordinates are skipped unless they are divisible by a power of two, with this power and the number of integers skipped increasing as accuracy continues halving until the coordinates eventually round up to infinity after 170 undecillion () units away from the coordinate origin.[2][3][4]

Video games using the traditional method of having the world center as the origin suffer from graphical, physics and terrain glitches at long distances that become progressively more severe the further the player gets away.[5][6][7] The most common artifact is a graphical spacial jitter caused by vertices in polygon meshes snapping to the nearest available coordinate.[1] Using more precise formats, such as the double-precision floating-point format, helps postpone the distance effects to further coordinates, but at a computational cost. The floating origin method allows travelling greater distances without precision errors, since coordinate precision will be lost the further the object is from the camera instead of an arbitrary point in the world. The method also allows using less precise but more performant formats, such as the half-precision floating-point format that would otherwise be unreasonable.[4]

Technique

A common implementation of the floating origin method involves geometric transformation of the world around the stationary camera such that it appears the camera itself is moving and rotating.[2] This approach is believed to be pioneered by Christopher G. Thorne in 2005.[1][6] If needed, a higher precision floating-point format may be used to represent the absolute position of objects.[8] Alternatively, the world and camera may be snapped to origin after reaching a specific distance threshold. Depending on the implementation, this approach can be more performant.[3][7][9] This technique is often called origin shift.[4][10][11]

Floating Origin has been verified to work for single and multiplayer. Verification included proving that all players stay at the origin, interaction and physics work normally, and all relative motion appears normal. A recent example of proof can be found in "Digital Relativism: Networked multiplayer Floating Origin verification" on youtube.

Note that there are misconceptions about the viability of multiplayer floating origin. For example: 1. There may be a problem with multiple cameras operating with the technique. 2. With one player at the origin, other players suffer the distance effects. 3. Using client-side coordinate calculation, which is usually limited to graphical calculations only.[8]

See also

References

Related Articles

Wikiwand AI