Code Name: ClothSimulationCompute
This example demonstrates GPU cloth simulation in Vulkan using a ping-pong compute pipeline, where 3 compute shaders (integration, Jacobi constraint solving, and update) run each frame to simulate a cloth grid under gravity with structural, shear, and bend constraints, plus collision against a sphere and ground plane.
| Input | Action |
|---|---|
| W/A/S/D | Move the camera |
| Mouse | Look around with the camera |
| Esc | Close the window |
| R | Restart the simulation |
| Space | Pause/resume the simulation |
| Parameter / Key | Type | Usage in Code | Description | Default Value |
|---|---|---|---|---|
| AppSettings.ClearColor | VkClearColorValue | AppSettings::ClearColor | Background color of the screen | |
| AppSettings.MouseSensitivity | float | AppSettings::MouseSensitivity | Mouse sensitivity value | |
| AppSettings.CameraSpeed | float | AppSettings::CameraSpeed | Speed of the camera |
- Understanding how to implement cloth simulation on GPU using compute shaders
- Learning how to apply updated vertex data from compute shader to vertex shader
| Shader Type | Status | Notes |
|---|---|---|
| GLSL | ✅ | |
| HLSL | ❌ | Will be implemented. |
| Slang | ❌ | Will be implemented. |
None
Window system-dependent extensions:
- VK_KHR_surface
- VK_KHR_win32_surface (Windows)
- VK_KHR_swapchain
