Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Could Unity PhysX be accelerate on GPU's?

Discussion in 'Physics' started by Arowx, May 7, 2016.

Thread Status:
Not open for further replies.
  1. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Could Unity PhysX be accelerate on GPU's?
     
    AntonioModer likes this.
  2. eXonius

    eXonius

    Joined:
    Feb 2, 2016
    Posts:
    207
    No, Unity doesn't support GPU acceleration for the physics unfortunately.
     
  3. tomsseisums

    tomsseisums

    Joined:
    Oct 8, 2012
    Posts:
    37
  4. tomachinz

    tomachinz

    Joined:
    Mar 2, 2019
    Posts:
    15
    Bring data back from the GPU would arrive 1 frame late, whereas physics runs at least twice before each visual frame is rendered. GPU code runs best with the `const` variable type, which is not actually variable. Physics code needs to store new data in actual variable variables. And possibly depend on giant chunks of code accessible to the CPU. There is a game that does it: they have 100,000 fully 3D characters in play I forget the name of it. But you'd need to treat each character as a pixel.
     
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Unity has already looked into this many times and has chosen not to use GPU acceleration, and it's not for performance reasons. It's actually possible on any GPU these days. I think it's more of a staffing problem for this area of Unity, plus DOTS is on the way, so it's not just a technical reason.
     
  6. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,221
    And I think you'd get a few frames delay from game loop which would make some people unhappy, so that would be an option and we all know how much devs love to maintain extra code path.
     
  7. luskos

    luskos

    Joined:
    Mar 4, 2013
    Posts:
    48
    Why is it a a problem? I know of few options that will optimize physics. Physics matrix, excluding anything that should not matter from it. Playing with the values in Project Settings> Time, so physics calculations occur less often and just right for what you intend to do. Usage of more simple version of the mesh for physics where possible. And the best option over all is to upgrade account and use the alternative physics system Unity provides that runs at least 2 times more efficiently. If you limit the usage of Rigidbodies you'll have better performance.
     
  8. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,816
    Locking this thread as it is very old. Please create a new one if you'd like to continue the conversation.
     
Thread Status:
Not open for further replies.