Skip to content

Nebulavenus/forge-gpu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

440 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

forge-gpu

forge-gpu aims to be a helpful guide to developing real-time graphics with SDL3's GPU API and building games. The project is written using C99, and features standalone lessons, tracks covering rendering, math, engine fundamentals, UI, physics, and asset pipelines.

Not related to The Forge rendering framework — forge-gpu is an independent educational project built on SDL3.

The lessons build on shared, header-only C libraries, a Python asset pipeline, and include reusable AI skills. SDL3 GPU handles the platform abstraction over Vulkan, D3D12, and Metal.

First Triangle
First Triangle
Point Light Shadows
Point Light Shadows
Planar Reflections
Planar Reflections
Pipeline Skinned Animations
Pipeline Skinned Animations
UI Rendering
UI Rendering
Indirect Drawing
Indirect Drawing

See the GPU track for all lessons.

Audio
forge_audio.mp4
Physics
forge_physics.mp4

Topics covered

Following along the GPU track you can build programs covering shadow mapping, screen-space reflections, bloom, SSAO, skeletal animation, stencil portals, and deferred decals. Lessons aim to introduce a new concept, sometimes more, building on the previous ones.

Other tracks fill in the foundations: math topics including transform and lighting calculations, how CMake and C work, how to build a UI system from font parsing to interactive controls, and how to process raw assets into GPU optimized formats.

What you'll get

Header-only C libraries (math, arena, containers, OBJ, glTF, UI, physics, procedural shapes, rasterization, pipeline loader, capture, audio, scene), a Python asset pipeline, and Claude Code skills that encode lesson patterns for AI-assisted building. All tested, documented, and usable in your own projects.

Getting started

Prerequisites

  • CMake 3.24+
  • A C compiler (MSVC, GCC, or Clang)
  • A GPU with Vulkan, Direct3D 12, or Metal support
  • Python 3.10+ (for helper scripts and the asset pipeline)
  • uv (Python package manager for the asset pipeline)

SDL3 is fetched as part of running the build.

Clone and build

git clone https://github.com/RosyGameStudio/forge-gpu.git
cd forge-gpu
cmake -B build
cmake --build build --config Debug
python scripts/run.py 01                  # by number
python scripts/run.py first-triangle      # by name
python scripts/run.py                     # list all lessons

Run python scripts/setup.py to verify your environment and diagnose missing tools. If you run into build problems, see the build guide — or work through the engine track, which covers CMake, compilers, and common errors from the ground up.

Lesson tracks

Tracks are specialized to specific topics. They cross-reference each other — GPU lessons link to helpful math lessons, engine lessons explain the build system and other relevant topics.

  • GPU — Rendering from a triangle to shadow maps, reflections, animation, and stencil effects
  • Math — Vectors, matrices, quaternions, projections, color spaces, noise, Bézier curves
  • Engine — CMake, C fundamentals, debugging, RenderDoc, git
  • UI — Immediate-mode UI from TTF parsing to draggable windows and developer tools
  • Physics — Particles, rigid bodies, collisions, constraints
  • Audio — PCM audio, WAV loading, mixing, SDL audio streams
  • Asset Pipeline — Texture compression, mesh optimization, procedural geometry, asset bundles, animation pipeline, web UI

Using Claude Code

The lessons, libraries, and skills are structured so Claude Code can navigate them.

While learning:

  • "What does SDL_ClaimWindowForGPUDevice actually do?"
  • "Why do we need a transfer buffer to upload vertex data?"
  • "Explain the dot product and show me the math lesson"

While building:

  • "Use the forge-sdl-gpu-setup skill to create an SDL GPU application"
  • "Add a rotating quad using the math library"
  • "Help me add textures to my renderer"

License

zlib — This project uses same license used by SDL.

About

Learn real-time graphics programming and build games with SDL's GPU API. Tutorials, code examples, and Claude Code skills

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors