What are the world limits?

After reading a couple of articles about the 32-bit limitations in unity’s coordinate system I started to experimenting how farther I could position an object without having any problem. I thought that I was going to be able to position them at least around <9999,999u in an axis, but at around 1000u the object’s shadow starts to tremble, at 2000u the shadow starts to shake. (Both in the scene view)

Also, the editor’s camera shake too when you try to pan it at ~2000.

What’s happening here guys?

I don’t know if it’s possible to see through this video, but here it is anyway:

Can someone explain exactly how this works?

2 Likes

It is floating point rounding errors.

It is worth keeping in mind that directional light requires 3 shadowmaps to be rendered, and in some computation shaders may be using half precision for the sake of speed.

So, 7 digits for the coordinate system, in practice, is just an illusion then? Seems like that starting from ~300u in any axis, the shadows already starts to shake… at least in the scene view, not sure if the shadows behaves the same in game view…:face_with_spiral_eyes:

1 Like

I think Unity were working on a large scale shadows solution (if anyone can share a link?)

Roughly you can travel a max of 10k from origin with good precision, real world sized objects and vehicles.

It varies with cameras as the fov Z order of camera can be stretched too far causing z fighting of nearby or far away objects.

See Kerbal Space Programs talk about making large scale solar system spanning worlds in Unity (below).

They used about 3 cameras/layered ‘scenes’ at different scales.

I never heard about any shadow solution for large worlds, only a shadow solution for very close stuff (PCSS-ish), the solution that they used in the blacksmith…

10km? If positioning objects at 300 meters far from the origin we already see the shadows glitching, how come 10000 meters will still work…

Check the quality settings for shadow sizes. → https://docs.unity3d.com/Manual/class-QualitySettings.html

On the large world shadows I think it was mentioned by a UT dev, do a search and check the roadmap just in case.

It’s in 5.5.x Roadmap

1 Like

Ah, that’s very good, still in 5.5!

nb. it does not affect shadow rendering in OpenGL which still uses the older depth buffer.
https://docs.unity3d.com/Manual/SL-DepthTextures.html