This repository is a Unreal Engine 5 plugin allowing to render a SOFA simulation scene inside UE5.
All SOFA VisualModel
components present in the loaded simulation will be rendered inside UE5 engine as Actor
with a GeneratedMesh
instance. Thus, it is possible to apply Unreal Engine Materials to each visual model and also to combine UE5 rendering pipeline with the SOFA simulation.
Important: This version allows only to change the Gravity and the TimeStep of the SOFA simulation and only the VisualModel are mapped into UE5. A full integration of SOFA components with a two-way communication will soon be avaible. |
- Unreal Engine version 5.0.3
- SOFA version >= 22.12 with SofaPhysicsAPI
- Only tested on Windows
- Install Unreal Engine version 5.0.3
- (optionnal) Create a new project
- clone the repo inside your Unreal Engine project:
git clone git@github.com:InfinyTech3D/SofaUE5-Renderer.git /UnrealEngine/myUE5Project\Plugins\SofaUE5-Renderer
- Copy the SOFA dll libraries inside:
/UnrealEngine/myUE5Project\Plugins\SofaUE5-Renderer/Binaries/ThirdParty/SofaUE5Library/Win64/
(for windows) - Restart Unreal Engine and reopen your project. The new plugin should be there.
Once the plugin has been loaded you should have this folders structure under Plugins/
- SofaUE5 Content contains several examples listed below with their corresponding SOFA scene as well as textures and Materials.
- SofaUE5 C++ Classes provide the components to be used to add SOFA simulation inside the UE scene
- Drag and Drop the SofaContext C++ class into your current level. This component will be added to the scene and can be access inside the Outliner. This compoment will create a SOFA simulation physically represented by this Actor in the Level.
You can access the SofaContext parameters by clicking on it and change its parameters. You can scale or move the SOFA frame to match your current scene. Other parameters linked to SOFA can also be changed like the gravity vector as well as the time steepping and activating the logs.
- Click on the button next to the
File Path
to load a SOFA scene. This will create anActor
SofaVisualMesh with aGeneratedMesh
for each SOFAVisualModel
SOFA simulation will be performed as soon as Unreal Engine is playing.
Three examples corresponding to SOFA Demo folder are provided inside the package: They are available in the folder /Scenes/Demos/
- Demo_01_SimpleLiver.umap -> Integration of Content/SofaScenes/liver.scn
- Demo_02_Caduceus.umap -> Integration of Content/SofaScenes/caduceus.scn
- Demo_03_Tissue.umap -> Integration of Content/SofaScenes/tissue.scn
Here are a some results of the integration:
This Unreal Engine plugin is under GPL-3 license.
Other license formats can be provided for commercial use. For more information contact: contact@infinytech3d.com.