Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

PhysX has origin shifting when will it appear in Unity?

Discussion in 'Physics Previews' started by Arowx, May 31, 2018.

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

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    PhysX has origin shifting -> https://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/guide/Manual/OriginShift.html

    When will this existing physics engine feature be added to the Unity API?

    After all you have done a lot of work with transform optimisation and multi-threading so in theory Origin Shifting although expensive computationally (every object/particle in the scene needs to move/shift at the same time) it could be accomplished across multiple-threads cores and be a lot smoother than on the old single core/thread system.

    It would open the door for much larger worlds that work with the physics engine without needing their own physics solution/simulation, assuming some form of physics/simulation LODing is applied for massive continents/battlefields with NPCs roaming about.

    Large simulation styles games would massively benefit from the addition of this feature.
     
    Tony-Lovell, Dinamytes and recon0303 like this.
  2. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
  3. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It's a very expensive operation according to nvidia, so Unity will have to devote a lot of time to this. I suspect personally, that it would probably be better to wait until Physx has been absorbed into ECS, as "moving" data around becomes much more efficient. Just my 2p.
     
  4. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    It's still way cheaper than moving all physics objects manually, that's main reason this feature exists in physx to begin with. Saying something is expensive operation is always somewhat relative thing: not every game has same variables on it's complexity, some target mobiles and some high end consoles, some have thousands of physics objects, some have hundred etc. Other engines like UE4 use this feat already but they also got built-in world shifting feature for everything.

    To get this done with Unity, I'd see few options here:

    1) Unity would implement proper origin shifting for every scene transform and user wouldn't need to take care of these things themselves (not very likely option as it's pretty big task and people work around it already).

    2) Unity would expose the physx origin rebase function and let users deal with the non-physics object shifting manually. This approach would require minimal work from Unity side and still let people use this functionality but it wouldn't be as sophisticated as option 1. This would also mean that once physics has been rebased, physics objects would sync into wrong place in scene if you didn't move non-physics objects and particles etc yourself (there could be additional option to automatically offset the physics transforms by the origin rebase value if it's desirable to rebase the physics sim alone).

    I personally would love to get more physx feats exposed even if it would mean they came in more raw form (yant knows my request for contact modifications for example). IMO, it's important to get as much as possible exposed from physx api as it's one of the last parts that Unity doesn't give you full control of. Most of the missing parts are rather advanced features anyway so added complexity would be a small price to pay if the alternative is to never get these features at all.
     
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    If you guys know it's the plan and @yant has said as such, should I lock this, because simply asking doesn't actually shorten the time it takes to be made. Last I checked they were still stabilising the upgrade.
     
    Cynicat likes this.
  6. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    It was in the previous build of PhysX so it's not upgrade dependent and where does the 'plan' or roadmap mention this feature?
     
    recon0303 likes this.
  7. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    This forum is physics previews, which means that the developer releases a build, and you talk about that. This thread isn't so I'm locking it but staff can change that if they wish :)

    What you are doing, belongs either as a enhancement request to something developers are talking about, or on the feedback site... (for feature requests).
     
Thread Status:
Not open for further replies.