No description
- Odin 96.4%
- GLSL 2.2%
- Shell 1.4%
| shaders | ||
| src | ||
| .gitignore | ||
| build.sh | ||
| README.md | ||
| run.sh | ||
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 targetEsc: quit
Requirements
- Odin compiler
- SDL3 installed on your system (for runtime linking)
- Vulkan-capable GPU/driver with SDL3 Vulkan support
glslc(fromshaderc) 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.glslandshaders/cubes.frag.glsl. - Runtime shader binaries are
shaders/cubes.vert.spvandshaders/cubes.frag.spv. - The app forces SDL3 GPU driver
vulkanand exits if Vulkan is unavailable.