Skip to content

Large World Shifting

Ziv edited this page May 21, 2026 · 1 revision

Overview

Large world shifting (aka rebasing) is a common technique in games with large open worlds to mitigate floating-point precision issues. The idea is to keep the camera and nearby objects close to the origin of the coordinate system, while applying an offset to all world coordinates to maintain the illusion of a large world.

Raylib pipeline is based on float precision, which means that when the camera operates far from the world origin, it can experience jitter and imprecision due to floating-point precision limitations.

Raytiles and Shifting

Raytiles supports shifting by providing the shift as part of the update() signature, but it does not manage the shift itself. This means that users of Raytiles are responsible for maintaining the world offset and applying it to their camera and other entities. Raytiles will then use this offset to convert between user-space coordinates (which are small and near the origin) and absolute tile-world coordinates (which can be very large).

streamer.update(camera, world_offset);

Clone this wiki locally