Skip to content

Repository files navigation

Vulkan Boing Ball Demo

A modern Vulkan implementation of the classic Amiga "Boing Ball" demo, featuring a red/white checkered sphere bouncing over a checkerboard floor.

Features

  • 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

Requirements

  • C++17 compiler
  • Vulkan SDK (1.2+)
  • CMake 3.16+
  • The following libraries (installed via package manager):
    • GLFW3
    • GLM

External Dependencies

Before building, you need to download these header-only libraries:

  1. volk: Download from https://github.com/zeux/volk

    • Place volk.h and volk.c in external/volk/
  2. VMA: Download from https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator

    • Place vk_mem_alloc.h in external/vma/

Building

  1. Download external dependencies:
./download_dependencies.sh
  1. 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/
  1. Compile the shaders:
./compile_shaders.sh
  1. Build the project:
mkdir build
cd build
cmake ..
make
  1. Run the demo:
./boing_ball

Architecture

The 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

Controls

  • Close window to exit
  • Window is resizable

Implementation Details

  • 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

About

Amiga Boing Ball demo reimagined with Vulkan

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages