Questions about scale of the game area

Two question about scale and performance:

I. Game area scale - If Physics is not used, is there a difference if game area is:

  • 100 x 100. Then player movement step - 1.
  • or 1 x 1. At this area, player movement step will be - 0.01

Is there a difference in performance between integer and float coordinates?

II. I read somewhere in the forum that models should not be scaled for better performance. Is this true? Or doesn’t matters?

In JavaScript, you don’t have Integer and Float types. You just have ‘Numbers’. Which are double precision floating point values, I believe. I don’t think model scale or scene size is related to performance per se. It’s more a question of precision. As numbers get very large, floating point rounding errors can creep in and you start to notice problem.

Here’s an example from @Crefossus:

There you see an object moving far away from the origin. This results in vertex transformation losing precision in the vertex shader.

3 Likes