With FOU, each client moves the objects in their worlds to recenter the player when a distance threshold is passed (or continuously). FOU will then syncronize client positions based on their respective world offsets. This functionality can easily be extended via FOU’s API.
FOU brings you flexibility to customize the frequency and precision level for recentering which can be more performant and customizable than a rigid continuous solution.
Disclaimers / Usage Tips
– If you have world space height fog you must not use the vertical recentering feature
– If you use world space shaders you may consider converting them to object space or introducing a global shader variable for FloatingOrigin space by hooking to the FloatingOrigin.OnOriginShifted(Vector3 newOffset, Vector3 translation)
– Objects marked static won’t work
– Doesn’t fix rendering problems with meshes that are insanely large. (ex. a 100000 x 100000 plane flickering)
– Physics calculations still depend on a certain client’s origin (usually the host)
– Physics interactions setups / controllers may have noticable jitter during frequent recentering
– Not a solution for placing distant objects in edit mode. Instead you should dynamically load/unload distant objects at runtime. (planet position table etc.)
– Any scripts which store positions should update those positions upon origin shift. To do this you should make use of the FloatingOrigin.OnOriginShifted event