I built a quick prototype in HDRP using the RVO example.
The RVO agent quad mesh was replaced with a complex LOD mesh.
This picture is the stats from 3 runs:
- base scene non DOTS
- non DOTS with custom mesh (3 meshes: body, spinning blade right and spinning blade left. total: LOD0: ~ 5000 triangles
- DOTS
Obviously, the non-DOTS with custom lod mesh example could be improved by combining all of the LODs into either a skinned mesh or some type of custom batching, but the ECS with physics is promising. Also, HDRP has a lot of overhead, but that’s what I’m using so I used it for the test. Keep in mind all of this is with the entity viewer and profiler running at the same time.
System
- Threadripper 3970x (32 core/64 thread)
- Geforce rtx 2080 ti
- 64 GB DDR4
RVO EXAMPLE DOTS TEST (IN HDRP)
Base: 122.4 fps
Non-DOTS w LOD mesh: 98.6 fps
DOTS: 98.7 fps
The time saved from the entity batching on the renderers is offset by roughly the same amount of the added overhead from the physics engine running. And I still need to investigate the physics workflow because it seems high to me at the moment.
There wasn’t much modification to the code:
RVOExampleAgent: at the start of Update I set the rvoagent transform to the entity translation and capture the starting translation before the calculations. At the end of the update, I assign the change in position to an entity component. In an ECS system, I add this offset to the translation of the entity.
I will continue to update as I test bullet collisions and other things.
