No description
  • Odin 96.4%
  • GLSL 2.2%
  • Shell 1.4%
Find a file
2026-05-29 00:36:15 +02:00
shaders init 2026-05-22 16:17:31 +02:00
src init 2026-05-22 16:17:31 +02:00
.gitignore stuff 2026-05-29 00:36:15 +02:00
build.sh init 2026-05-22 16:17:31 +02:00
README.md init 2026-05-22 16:17:31 +02:00
run.sh init 2026-05-22 16:17:31 +02:00

Odin + SDL3 GPU cubes (Vulkan only)

Small starter project in Odin that opens an SDL3 window, renders several 3D cubes with the SDL3 GPU API, and uses a Vulkan-only backend with SPIR-V shaders.

Controls

  • Left mouse drag: orbit camera
  • Middle mouse drag: pan
  • Mouse wheel: zoom in/out
  • W/A/S/D: move camera target
  • Esc: quit

Requirements

  • Odin compiler
  • SDL3 installed on your system (for runtime linking)
  • Vulkan-capable GPU/driver with SDL3 Vulkan support
  • glslc (from shaderc) to compile GLSL to SPIR-V

On macOS with Homebrew:

brew install odin sdl3 shaderc

Build and run

Quick start:

./run.sh

The script compiles shaders, sets VK_ICD_FILENAMES to MoltenVK if available, adds /opt/homebrew/lib to DYLD_FALLBACK_LIBRARY_PATH, and runs the app.

Compile shaders first:

glslc -fshader-stage=vert shaders/cubes.vert.glsl -o shaders/cubes.vert.spv
glslc -fshader-stage=frag shaders/cubes.frag.glsl -o shaders/cubes.frag.spv

From the project root:

odin run src -out:bin/cubes_gpu

Or build only:

odin build src -out:bin/cubes_gpu

Notes

  • Shaders source files are shaders/cubes.vert.glsl and shaders/cubes.frag.glsl.
  • Runtime shader binaries are shaders/cubes.vert.spv and shaders/cubes.frag.spv.
  • The app forces SDL3 GPU driver vulkan and exits if Vulkan is unavailable.