25 August 2016 at 0 h 47 min #7401MegaMindParticipant
Combining SOFA and a game engine will have tremendous utility for real-time visualizations. The two most popular game engines and best bet to use to get good results and help with are Unity3d and Unreal Engine. Unity3d is much more light weight with easier C# scripting for fast coding with no long compiling time as with C++ but it does have a way to use C++ code by using a C++ wrapper. I asked a pro about using external code and he said “You can, pretty much, integrate Unity with any 3rd party library or software via native plugins”. So it may be best to try to integrate that engine first however it does not come with full source code. That is where Unreal Engine comes in as it is a full featured professional engine as well but it comes with full source code. The only downside is you really need a stomping good computer because compile times can take hours and ongoing changes to code always takes minutes rather than seconds in Unity. And I have learned speed to see if some code works is super important.
If possible an extrapolated way to hook in a game engine should probably be first made to work with Unity then go for Unreal. It’s too difficult to say which would be better because they both have their benefits. In the long run it may turn out Unreal is best due to all C++ code base and full source code with a proper C++ plugin API. So all comments welcomed and hopefully someone will rise to the challenge. Andrey P2 September 2016 at 11 h 49 min #7429
Once again, thank you Andrey for your motivations on these topics “couple SOFA with ..”!
We do not have internally the experience of people working with Unreal Engine. As you mentioned, Unreal is a big software, but known as a very powerful tool. Coupling SOFA with Unreal could be very well perceived in the UE community. Moreover, several developers in the SOFA community are currently interested and working on this specific topic: @mtcooper115 intended to create SOFA simulation with UE and @epernod is a curious dev interested on this. I am pretty sure, many other would have interest in this.
So if any of you, made some progress or want to share his/her experience about SOFA and UE, please do not hesitate to carry on commenting this.
Coupling SOFA with Unity will be discussed here: https://www.sofa-framework.org/community/forum/topic/combining-sofa-and-unity/.
Hugo6 September 2016 at 10 h 34 min #7448epernodParticipant
I have been working a little with Unity3D. Indeed, it is very user-friendly and very fast to obtain results.
I didn’t get through the plugin creation system but I saw how look the PhysX one. So I can imagine what is possible.
However I spent some time going through lot of forum checking the pros and cons of Unity vs Unreal. It sounds a little like the battle Windows vs Linux 🙂
Unreal is much more complicate to get into… but, I think, much more powerful, flexible and the Engine/Editor works on linux with C++, which makes a big difference for me! And finally the pricing system is better for my activity.
Anyway, right now, I’m getting deeper into the UE plugin mechanism. Thus I would like to gather some ideas of what could be he combination of Sofa with UE.
Could you help me identify some simple usage scenario.
Erik15 September 2016 at 8 h 51 min #7480MegaMindParticipant
Hi Eric I am pleased to hear that you have an interest in combining UE & SOFA. The usage scenario to start would be to crate a stand alone interface such as the runSOFA GUI combined with a PhysX editor to create the joints/constraints. Since UE uses Visual Studio continuing this would be best however that means building off the runSOFA is not possible as it is build in QT. But since a new GUI really is the way to go in the long run as to avoid any licensing issues and control over code that is ok. Unity3d and Blender can be looked at for inspiration on how to handle the physics constraints GUI and also there is a PhysX editor just released that is open source that will be a goldmine called PEEL which is a tool designed to evaluate, compare and benchmark physics engines and the good thing is that it abstracts the physics engine so adding in SOFA may be fairly easy and then we could have many physics engines to work with. I would also highly recommend studying the code and GUI of what the Digital Trainers (Clément Forest) did with SOFA Blender. It would be so nice to actually get the SOFA Front End tool they made to work and then it may be possible to get Unity3d and UE both to be working easily however their pricing model and closed source free release prohibits this. However the ultimate goal that may be out of reach but the best way to handle the joints/constraints is how the CAD programs do it such as SolidWorks and Fusion360. The CAD engines use a geometric constraints engine and are complex and I have not found a good open source one we could use. Plus they also are working with B-rep NURBS models however I think I may have found some ways it could be done. Anyway it would be cool if you could document your progress and have a GitHUb repository setup.12 December 2016 at 23 h 28 min #8080
Here is a post from Erik about SofaPhysicsAPI, it could be of interest.
Hugo15 December 2016 at 9 h 30 min #8209François FaureParticipant
- Univ.Grenoble, Anatoscope
it looks like we all agree that the UE/Unity3D discussion can last forever the same way as Windows/Linux or Emacs/vi, so I suggest we adopt a pragmatic viewpoint.
We (Anatoscope) have potential customers for simulations in Unity3D, so we are going to move this way.
Any interest of the Sofa community (people, consortium) to participate ?
best,13 June 2019 at 11 h 05 min #1364914 June 2019 at 12 h 18 min #13688BineshParticipant
- Developer,Modeler And Eye Surgical Simulation Researcher At Simedix.co
In our company we established a communication with SOFA and UE
Our communication method is IPC(Inter Process Communication)
Our IPC method is Network And Shared Memory14 June 2019 at 14 h 40 min #13689
Thank you so much for this very interesting feedback.
Work at Simedix is impressive, carry on the good work!
Hugo15 January 2020 at 11 h 48 min #15099
I am writing you to give you some additional updates. On top of last year integration of SOFA within Unity3D, other independent developers are actively investigating the use of SOFA as the physics engine in Unreal Engine. Check out this latest video:
In case you are interested for collaborating, co-developping or consulting these indiedevs, do not hesitate to contact us.
- You must be logged in to reply to this topic.