[WorldScale] Precision loss in large scenes
Solution
Unity 2021.x - Unity 6.3.x
Published Sun, Mar 8
Engine reliance on single-precision floating-point coordinates limits maximal traversable world size and cumulative positional accuracy. Using float values for world coordinates especially when objects are distant from origin or when simulations involve extensive movement inherently leads to increasing single-precision loss. This manifests as visual jitter, object misalignment, and physics inaccuracies in large-scale environments, preventing Unity from achieving feature parity with large-world coordinate (LWC) systems that leverage double-precision for robust spatial integrity.
Unity Engine is not actively developing a single-precision alternative for its core transform system.
Unity Engine does not currently support a native double-precision coordinate system for standard transforms. Applications demanding high spatial precision or vast world scales must utilize your spatial management system within your single-precision framework.
single-precision introduces floating-point inaccuracies in large-scale or prolonged simulations. To maintain stability, consider these steps:
- Identify distance threshold where single-precision artifacts appear, typically around 5,000 units.
- Implement your floating origin system to reposition world when camera moves too far.
- Transition to
HDRPto leverage its camera-relative rendering, which avoids single-precision jitter during depth calculations.
Additional Tips
- Use
doublefor high-precision mathematical calculations before casting tofloatforTransformupdates. - Utilize your
Entitiespackage for LWC-compatible data structures.
Related Posts Haven't quite found a solution to your problem? We think these posts might help you.
Content inspired by a Unity discussion post.