UnityRef is currently in early development. Some features may be incomplete and/or not functioning.

UNITYREF

Your Pit Stop For Solving ANYTHING in Unity

architecture

[WorldScale] Precision loss in large scenes

Solution

coroutinesbuild optimizationphysicsnetworkingproject architecture

Unity 2021.x - Unity 6.3.x

Published Sun, Mar 8

Issue

 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.

Explanation

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:

  1. Identify distance threshold where single-precision artifacts appear, typically around 5,000 units.
  2. Implement your floating origin system to reposition world when camera moves too far.
  3. Transition to HDRP to leverage its camera-relative rendering, which avoids single-precision jitter during depth calculations.

Additional Tips

  • Use double for high-precision mathematical calculations before casting to float for Transform updates.
  • Utilize your Entities package 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.