Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Graphics have LODs why don't physics engines have LOD, or do they?

Discussion in 'General Discussion' started by Arowx, Apr 30, 2018.

  1. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    So to reduce the load on your CPU/GPU you LOD so more distant object are less complex and you can have more of them.

    Therefore why don't physics engines have LOD, a basic test to find if it's a possible hit the a LOD jump to test if it hit a more accurate model then maybe another LOD test to find out where it hit on the model.

    They probably have some form of LOD already so excuse my ignorance of the inner workings of 2D/3D physics engines, although please point me in the direction of enlightenment.
     
  2. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    Usually Physics LOD mesh complexity is lower than the object mesh complexity to begin with, or at least they should be if you want a performant scene. One problem at least with Unity Physics is changing LOD meshes puts quite a strain on the system CPU, and is not something you would want to do a lot of especially with complex meshes. In most cases it's enough to have a simplified physics LOD up close and then to drop physics LOD altogether for far away objects.
     
  3. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Everything has LOD.

    For example you'll do less ticks of AI in the distance, or calculate less. Same for all your scripts. I would use the term scaling. So you'd scale your logic based on priority and perhaps distance in the same way you do your media. Sounds fall off, and so on.
     
  4. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,504
    That's how they work all the time anyway.

    Collision detection and physics are typically split into two phases, "broad" and "narrow".

    In the "broad" phase some incredibly simplified data is used to generate lists of "possible hits". Using a spatial data structure such as an octree you don't even have to test every pair of objects, you can rule out most collisions just by knowing what cells things are in.

    Then, for the "narrow" phase", once you have that list of possible hits you check each pair in that list. First with sphere-sphere collisions because they're very simple and fast, then with iteratively more expensive checks until you have a definitive and precise result. Detailed checks are expensive, but you don't have to do them for many objects.

    So... that's pretty much as "LOD"d as you can get.

    Also, this is a really detailed, well studied and documented area of research. A little searching will get you loads of great, detailed information that covers it far better than my couple of paragraphs.
     
    Ryiah and hippocoder like this.
  5. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    If you have objects A and B that can interact, does it matter where they are in relation to C?

    If the actions between A and B can have lasting effects that can eventually impact C, then it seems that physics needs to be consistent regardless of distance from C.

    I can think of some cases where fudging on that might be viable. But for me the norm has been you need to solve physics performance by using different approaches, which often involves just using simpler physics api's.
     
    angrypenguin likes this.