Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Our response to Improbable’s blog post (and why you can keep working on your SpatialOS game). Read more here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Implementing more PhysX on Unity via dll

Discussion in 'Editor & General Support' started by PauloBarbeiro, Mar 13, 2009.

  1. PauloBarbeiro

    PauloBarbeiro

    Joined:
    Sep 10, 2008
    Posts:
    15
    Hi every one!

    I was looking at PhysX and could realize that Unity do not implement all it's possibilities, like softbodies and fluid simulation. I think there are some good reasons for that - I imagine that some old computers could not be able to simulate some of those features, as well iPhone, could not be able too. - And searching through out the forum I saw some really good attempts to implement softbodies.

    While studying PhysX, I saw that the engine core (at windows) are some dlls, and then an idea just passed through my mind:

    Is it possible to extend PhysX on Unity accessing those dlls?

    The AngryAnt pathfinder project is a dll, that is accessed using C#, so, in the same way, is it Possible to access PhysX dlls?

    I don't know (yet) how to program dll, and how to extend Unity, but as far as i could understand (base on AngryAnt's project), the MonoBehavior allows us to access dlls classes and methods, but in this case, how integrate the simulation results from PhysX with Unity render system?

    If some one could give a little tip, and inicial guidance, about how to implement some new NxActors? :)


    thanks a lot!
    Paulo

    p.s.: Congrats to all guys who work on some softbudies solutions!
     
  2. PauloBarbeiro

    PauloBarbeiro

    Joined:
    Sep 10, 2008
    Posts:
    15
  3. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,600
    No, I don't think its really possible at least not if you don't want to mess with the existing one because you can not have the regular unity without physx as physx is handling even basic collision for example.

    Also adding fluids, softbody etc is not really an option from outside as you will have to update the geometry dynamically through the script end while the animation and other things access the stuff as well so you might lose a considerable amount of performance.


    The main reason that Unity likely isn't on the current version is that there is no PhysX for OSX. They had to integrate it from source for the technology which also means that an upgrade is not just a "drop in, redirect headers and thats it" as on Windows where the DLL etc are present and you only n eed to adapt to changed API functionality. If it required any kind of modifications to work correctly for example, thats no simple thing.

    Also changes in the physx version means that all physx and collision related things must be fully retested. its by no means a simple thing at all.
     
  4. PauloBarbeiro

    PauloBarbeiro

    Joined:
    Sep 10, 2008
    Posts:
    15
    Thanks for the answer Dreamora!

    Well, I wasn't expecting that it would be easy at all, just if it was possible.

    The absence of a PhysX version for Mac arghhh... no comments about it.... crap... :(

    But thanks for the answer anyway.
     
  5. Teknoman117

    Teknoman117

    Joined:
    Aug 2, 2012
    Posts:
    3
    Physx run on Mac OS X now, even GPU accelerated!
     
  6. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,600
    yes but not in Unity

    Unity has its own modified physx and has cut out HW acceleration (as its nvidia gpu only anyway) as well as multithreaded physics (exception: cloth)
     
  7. ImogenPoot

    ImogenPoot

    Joined:
    Jul 2, 2012
    Posts:
    214
    The NVidia GPU only is the only thing that really bothers me... Maybe Bullet Physics would be an option for the future ;).