A project that simulates squishy pixel-art spaceships using a parallel mass-spring-damper physics model executed entirely on the GPU via GLSL shaders. Each pixel is modeled as four interconnected masses with spring and damper forces. State is stored in RGBA32F textures using a ping-pong strategy, and RK4 numerical integration is performed across 8 render passes per stage. The system achieves 60 FPS with up to 75 RK4 stages per frame on a mid-range laptop GPU. Ships are defined as PNG images, with specific pixel colors designating thrust engines. The implementation uses OpenGL 3.3, C++11, glfw, and libpng.

4m read timeFrom mattkeeter.com
Post cover image
Table of contents
AboutPhysicsIntegrationShipsChallengesImplementationReferences

Sort: