Games: Godot and Open 3D Engine
-
Emulating Double Precision on the GPU to Render Large Worlds
One of the problems with developing games with large game worlds is that objects start to jitter and teleport around as you move away from the world origin. This post is about how we overcame one challenge in particular and what we did.
The Problem
By default Godot uses single-precision floating point numbers to store things like object positions. While GDScript typically allows users to do user-space calculations with double precision, those calculations get truncated as soon as they are stored in Godot internal objects (like Vector3’s).
This has been a problem for users who want to do things like make games that take place in a to-scale solar system. Users quickly hit floating point precision errors and noticed that movement becomes jittery and objects become scattered.
As an example, take a look at this simple scene, we have a bunch of Godot's scattered randomly and a person running back and forth across the screen.
-
Release Notes for Open 3D Engine 22.10.0 - Open 3D Engine