What are the general guidelines on deciding on a scale for my coordinate system?

All other things equivalent (complexity of textures, models, etc), does the scale I use for my coordinate system matter or affect performance? In other words, would rendering a “larger” world with a larger arc camera radius (in terms of xyz) be more expensive than an equivalent world that’s scaled down?

I’d guess it doesn’t have an impact, but just thought I’d double check :slight_smile:

Hey!
It is not more expensive but it will be less precise. Float numbers work better on small scales

3 Likes

As Deltakosh said, it doesn’t really affect performance, however, due to way floating numbers work on computers, there are some things to be aware about. One common point is Depth Buffer precision: since most of its precision is “condensed” close to the near plane values, if you have a large range of distances you will need some modifications to ensure the depth test still works fine.
These articles and video go a little more in depth explaining the problem and possible solutions:

Thankfully Babylon.js already has support for logarithmic depth buffers Logarithmic Depth Buffer | Babylon.js Documentation :slight_smile:

These depth buffer precision issues also plague shadow algorithms, so another place to watch out would be here. Here are some more articles:

If you have any questions about these points or any other ones, feel free to ask!

3 Likes