Large World Rendering
Hey all! We’re introducing LargeWorldRendering for 9.0 to prevent jittering caused by floating point imprecision when dealing with large coordinate systems calculations.
Note that the feature is still experimental / in development (there are some known limitations today, such as shadow rendering and billboard/infinite distance modes) however we can use this thread to consolidate asks/observations related to floating origin / large worlds ![]()
You can see usage in this playground which enables swapping between scenes and testing combinations of the below engine/scene creation options. Left is without largeWorldRendering, right is with. And if you move camera you will see the jittering is gone ![]()
For complete large-world rendering support across all scenes:
create engine with { useLargeWorldRendering: true }. This will internally
- Set engine to useHighPrecisionMatrix – which uses 64bit matrix computations instead of 32bit default, ensureing we don’t lose accuracy in the CPU-side math when calculating matrices on large world coordinates
- Set all scenes to useFloatingOrigin – which offsets matrix uniforms (plus some position-related uniforms/attributes) before passing to shaders – centering the camera at world origin and displacing all other scene nodes by camera’s world position. This ensures accuracy in the GPU math, as the scale of values sent to shader are smaller and can be handled with 32 bit floats.
For scene-specific large-world rendering:
create the scene with { useFloatingOrigin: true } and create engine with { useHighPrecisionMatrix: true }
- Doing this reduces perf impact on smaller coordinate-based scenes (because we can avoid offset matrix calculations)
- (highPrecisionMatrix is an engine-level setting that cannot differ per-scene)
Some notes
P.s: Note that because the floatingOriginOffset is applied right before sending values to shaders, the offset is not detectable from any public matrices / position getters (which was a guiding philosophy as I implemented)
This ensures all logic within Babylon or written by users can remain unchanged regardless of mode.
P.s.s: Also note that the usage of this feature has changed in Pull Request #17334 · BabylonJS/Babylon.js, previously it was only a scene-level creation option called ‘floatingOriginMode’).
I will add robust documentation once the feature is no longer experimental / the API is confirmed!
——————————
CCing some folks who have posted about floating origin in the past!
@3D_Wave_Design Origin Shifting (dealing with floating point precision)
@Peipol Floating Origin Physics - Questions - Babylon.js
@Petros_Pap Zoom and scaling issue, mesh flickers on movement - Questions - Babylon.js
@CrashMaster Floating origin breaks rendering when camera has a parent - Bugs - Babylon.js
@Luck_Good @imerso Why doesn’t babylonjs use (Rendering Relative to Eye) to solve the loss of precision? - Questions - Babylon.js
@Stanikkje Big and small objects - Questions - Babylon.js
@qbrunner How to fix model glitching when far away from origin - Questions - Babylon.js
@Pryme8 @samuelgirardin @imerso Floating Origin Template for BJS 5.x - Demos and projects - Babylon.js
@plopidou Why is this happening? Mesh wobble when getting close - Questions - Babylon.js
@jetibest How to do high precision transformations? - Questions - Babylon.js
@cosmochristo When I am panning the camera the model loss the precision, how can I increase the precision? - Questions - Babylon.js
@Arash_Bagheri I want to show a simple cube at the position (6738120, 1384, -4123270), But there are some distortion, what is the problem? - Questions - Babylon.js
@lucas-divinestar Rendering at 100k+ Meters Many Issues - Questions - Babylon.js
@Romain Large coordinates - Questions - Babylon.js


