A modern Vulkan implementation of the classic Amiga "Boing Ball" demo, featuring a red/white checkered sphere bouncing over a checkerboard floor.
- Red/white checkered bouncing ball with rotation
- Checkerboard floor pattern
- Dynamic shadow that scales with ball height
- Simple physics with squash/stretch animation
- Procedural textures (no external assets required)
- Blinn-Phong lighting with rim lighting
- C++17 compiler
- Vulkan SDK (1.2+)
- CMake 3.16+
- The following libraries (installed via package manager):
- GLFW3
- GLM
Before building, you need to download these header-only libraries:
-
volk: Download from https://github.com/zeux/volk
- Place
volk.handvolk.cinexternal/volk/
- Place
-
VMA: Download from https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
- Place
vk_mem_alloc.hinexternal/vma/
- Place
- Download external dependencies:
./download_dependencies.sh- Install shader compiler (if not already installed):
# On macOS:
brew install glslang
# On Ubuntu/Debian:
sudo apt-get install glslang-tools
# Or install Vulkan SDK from https://vulkan.lunarg.com/- Compile the shaders:
./compile_shaders.sh- Build the project:
mkdir build
cd build
cmake ..
make- Run the demo:
./boing_ballThe demo uses:
- VK_KHR_dynamic_rendering for simplified rendering (no render pass objects)
- Push constants for per-object transforms and parameters
- Uniform buffer for camera, lighting, and time
- Procedurally generated icosphere mesh
- Three separate pipelines: ball, floor, and shadow
- Close window to exit
- Window is resizable
- Ball: Icosphere with spherical UV mapping and checker pattern in fragment shader
- Floor: Large quad with world-space checker pattern
- Shadow: Flattened sphere rendered with alpha blending
- Physics: Simple harmonic motion with gravity and bounce mechanics