Vertices are getting misplaced for high x,z values

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By humbletang

I have vertices that I’m adding to an ArrayMesh and then a MeshInstance and they are offset a certain amount from <0,0,0>. I find that if I don’t attempt to undo this offset then my points get rendered in a slightly off fashion.

When I offset the set of vertices by the position of the first vertex I get this.

The coordinates that I’m offsetting by are a little high, but certainly nowhere close to the float32 ceiling.

The bounding box for the entire point cloud when it isn’t shifted to the origin is 409001, 0.957346, 3660087.5 - 0.6875, 0.2037, 0.5

Anyone know what’s causing this?

I think in the documentation there’s a hint about the problem that’s coming up here. Optimizing 3D performance — Godot Engine (stable) documentation in English They remark that when numbers are too large they suffer from floating point errors. This could be the issue, so by shifting we essentially are moving the whole world closer to the camera starting position so the rendering has fewer rounding errors placing points in the same spot?

humbletang | 2023-01-30 00:30