The repository contains implementation of Sand Balls mechanic using different approaches to deform a mesh. The goal is to play around with MeshData API and compute shader with AsyncGPUReadback. And then compare its performance to other approaches.
The following samples were implemented:
- Naive implementation
- Naive implementation using ProBuilder Mesh
- Jobified naive implementation
- Compute shader with AsyncGPUReadback
- MeshData modification on the main thread for easier debugging
- MeshData modification using jobs
Each sample can be found inside the Scenes folder
Run on OnePlus 9 (Snapdragon 888, VSync on (forced), 120Hz refresh rate)
Method | Median | Dev | StdDev |
---|---|---|---|
DeformableMeshPlane_ComputeShader_PerformanceTest | 8,27 ms | 0,43 ms | 3,53 ms |
DeformableMeshPlane_Naive_PerformanceTest | 8,27 ms | 0,39 ms | 3,25 ms |
DeformableMeshPlane_NaiveJob_PerformanceTest | 8,27 ms | 0,19 ms | 1,58 ms |
DeformableMeshPlane_MeshData_PerformanceTest | 8,27 ms | 0,19 ms | 1,58 ms |
Run on Intel Core i7-8750H CPU 2.20GHz (Coffee Lake), 1 CPU, 12 logical and 6 physical cores NVIDIA GeForce GTX 1070
Method | Median | Dev | StdDev |
---|---|---|---|
DeformableMeshPlane_ComputeShader_PerformanceTest | 1,37 ms | 3,91 ms | 5,66 ms |
DeformableMeshPlane_Naive_PerformanceTest | 15,37 ms | 0,11 ms | 1,65 ms |
DeformableMeshPlane_NaiveJob_PerformanceTest | 6,76 ms | 0,88 ms | 5,97 ms |
DeformableMeshPlane_MeshData_PerformanceTest | 6,72 ms | 0,83 ms | 5,60 ms |
More details and the conclusion in blog posts: