Search Unity

Floating Point Errors and Large Scale Worlds

Discussion in 'World Building' started by Phelan-Simpson, Apr 15, 2018.

  1. cosmochristo

    cosmochristo

    Joined:
    Sep 24, 2018
    Posts:
    147
    Each frame, the graphics pipeline multiplies all of the transforms in the Scene hierarchy above each object, into a total transform to position it. Adding one transform on top is not a significant change.

    Furthermore, if I move towards an object or I move the object towards me, the relative motion is identical: it is this same number of polygons moving in the same direction at the same time. In other words, no difference in performance of measurable worth.

    The idea that it would give a large performance hit only comes from algorithms that loop over every object to move them, instead of using the transform hierarchy.

    If by "physics world" you are referring to Rigid Body objects, then they are the same in this regard as other objects: RBs are a component attached to objects and the transform of an RB is the transform of the parent object. Actual physics is done by mathematical models, not polygons.

    The current CFO demo already has a bunch of green RB boxes that are transformed with the rest of the scene and they behave normally when something moves through/interacts with them. The Avatar is also shown colliding normally with objects and gravity also working. All this is done under the relative motion system I described.

    I will soon be making a demo with more physics/action that also moves everything via relative motion. That may be more convincing for you.
     
  2. cosmochristo

    cosmochristo

    Joined:
    Sep 24, 2018
    Posts:
    147
    The current CFO asset is half price and has the code - very simple.

    Sorry, I did not answer the projectile question. I have not tried it, so I don't know what changes may be required. Logically, all the relative motion is the same - unless I am missing something!
     
unityunity