How rawiazam/unity_2d_spring_mesh works
This Unity project is a GPU-accelerated 2D spring-mesh visual simulation. Its principal workflow is to initialize a grid of points and neighbor/restoring springs, apply mouse-click impulses, execute spring simulation on the GPU, and render the resulting mesh. The README identifies SpatialMap as redundant and describes density-based rendering as a possible improvement; the tree contains related shader assets, but no source excerpts were available to verify their runtime wiring.
Main entry points: spring_mesh.cs SpringMesh · impulse.cs Impulse · spring.compute Spring compute · mesh_point.cs Mesh point
Components 12
Mesh simulation
- SpringMesh
Assets/scripts/spring_mesh.cs - Mesh point
Assets/scripts/mesh_point.cs - SpatialMap
Assets/scripts/SpatialMap.cs - Spring compute
Assets/scripts/spring.compute
User interaction
- Impulse
Assets/scripts/impulse.cs
Rendering
- DynamicMesh
Assets/scripts/dynamic_mesh.cs - Density map compute
Assets/scripts/shader/DensityMap.compute - Density view
Assets/scripts/shader/densityView.cs - Density shader
Assets/scripts/shader/Dens.shader - Quad material setup
Assets/scripts/shader/QuadSetMaterial.cs
Other components
- User
- Sample scene
Assets/Scenes/SampleScene.unity
Connections 5
- SpringMesh → Mesh point: creates points
- SpringMesh → Spring compute: executes simulation
- User → Impulse: clicks
- Impulse → Spring compute: sets variables
- SpringMesh → DynamicMesh: updates mesh