← Back to all projects

GRAPHICS API MASTERY OPENGL VULKAN DIRECTX

To truly understand graphics APIs, you need to understand what they're abstracting and *why* the abstraction level matters. Let me break this down:

Graphics API Mastery: OpenGL, Vulkan, and DirectX

Understanding the Core Concepts

To truly understand graphics APIs, you need to understand what theyโ€™re abstracting and why the abstraction level matters. Let me break this down:

The Fundamental Question: Who Controls the GPU?

API Abstraction Level Control Driver Complexity
OpenGL High Driver does heavy lifting Complex, smart driver
DirectX 11 High Similar to OpenGL Complex, smart driver
Vulkan Low Programmer controls everything Thin, dumb driver
DirectX 12 Low Similar to Vulkan Thin, dumb driver

Why This Matters for Performance

High-Level APIs (OpenGL, DX11):

  • Driver must โ€œguessโ€ what you want and optimize behind your back
  • Single-threaded command submission (major bottleneck!)
  • Driver tracks resource state for you (hidden overhead)
  • Easier to use, but less predictable performance

Low-Level APIs (Vulkan, DX12):

  • You tell the GPU exactly what to do, when
  • Multi-threaded command buffer recording (massive CPU win)
  • You manage memory, synchronization, and state explicitly
  • Harder to use, but predictable and faster when done right

Real-World Performance Data

From benchmarks:

  • Vulkan vs OpenGL: 25-46% higher FPS in GPU-heavy scenes due to reduced driver overhead
  • Multi-threading: Vulkan delivers 2x higher minimum FPS under CPU bottleneck conditions
  • Simple scenes: OpenGL can actually be faster (9800 FPS vs 7800 FPS for a triangle) because Vulkanโ€™s explicit control has setup overhead
  • The takeaway: Vulkan wins when you have many draw calls; OpenGL wins for simplicity

Platform Compatibility Matrix

API Windows Linux macOS Android iOS Xbox PlayStation
OpenGL โœ… โœ… โš ๏ธ Deprecated โœ… (ES) โš ๏ธ โŒ โŒ
Vulkan โœ… โœ… โœ… (MoltenVK) โœ… โœ… (MoltenVK) โŒ โŒ
DirectX 11 โœ… โŒ โŒ โŒ โŒ โœ… โŒ
DirectX 12 โœ… โŒ โŒ โŒ โŒ โœ… โŒ
Metal โŒ โŒ โœ… โŒ โœ… โŒ โŒ

The Graphics Pipeline: What Youโ€™re Actually Controlling

CPU (Your Code)
    โ”‚
    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    GRAPHICS PIPELINE (GPU)                       โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Input Assembler โ†’ Vertex Shader โ†’ Tessellation โ†’ Geometry      โ”‚
โ”‚         โ”‚              โ”‚              โ”‚              โ”‚          โ”‚
โ”‚         โ–ผ              โ–ผ              โ–ผ              โ–ผ          โ”‚
โ”‚     Rasterizer โ†’ Fragment Shader โ†’ Depth Test โ†’ Framebuffer    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ–ผ
Display

The key insight: In OpenGL, the driver decides when and how to execute these stages. In Vulkan, YOU record commands into buffers and submit them explicitly.


Project 1: The Triangle Triptych โ€” Same Triangle, Three APIs

  • File: GRAPHICS_API_MASTERY_OPENGL_VULKAN_DIRECTX.md
  • Main Programming Language: C++
  • Alternative Programming Languages: C, Rust, Zig
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: 1. The โ€œResume Goldโ€
  • Difficulty: Level 2: Intermediate
  • Knowledge Area: Graphics Programming / API Comparison
  • Software or Tool: OpenGL, Vulkan, DirectX
  • Main Book: โ€œVulkan Programming Guideโ€ by Graham Sellers

What youโ€™ll build: Render the exact same colored triangle using OpenGL, Vulkan, and DirectX 12. Compare the code complexity, initialization steps, and frame timing.

Why it teaches Graphics APIs: This is the โ€œHello Worldโ€ of graphics. By implementing the same output in three APIs, youโ€™ll viscerally feel the difference in abstraction levels. OpenGL: ~200 lines. Vulkan: ~1000+ lines. Same triangle.

Core challenges youโ€™ll face:

  • Context/Device initialization โ†’ Understanding what the API needs before rendering
  • Shader compilation (GLSL vs HLSL vs SPIR-V) โ†’ Maps to shader pipeline differences
  • Buffer creation (vertex data) โ†’ Maps to memory management philosophy
  • Draw call submission โ†’ Maps to command buffer vs immediate mode
  • Swap chain presentation โ†’ Maps to display synchronization

Key Concepts:

  • Graphics Context Creation: โ€œOpenGL Programming Guideโ€ Chapter 1 โ€” Shreiner et al.
  • Vulkan Instance & Device: โ€œVulkan Tutorialโ€ โ€” vulkan-tutorial.com
  • Shader Languages: โ€œOpenGL Shading Languageโ€ Chapter 1 โ€” Rost & Licea-Kane
  • Swap Chain Management: โ€œVulkan Programming Guideโ€ Chapter 5 โ€” Graham Sellers

Difficulty: Intermediate Time estimate: 1-2 weeks Prerequisites: Basic C++, understanding of what a GPU does

Real world outcome:

# You'll have three executables:
./triangle_opengl   # Window with colored triangle, ~60 FPS
./triangle_vulkan   # Window with colored triangle, ~60 FPS
./triangle_dx12     # Window with colored triangle, ~60 FPS

# But the real outcome is understanding:
# - Why Vulkan needs 10x more code for the same result
# - What that extra code actually controls
# - When that control matters

Implementation Hints: The key is to structure all three projects identically:

  1. Initialize window (use GLFW for portability)
  2. Initialize graphics API
  3. Create shaders
  4. Create vertex buffer with triangle data
  5. Main loop: clear, draw, present

For Vulkan, youโ€™ll need: instance, physical device, logical device, queue, swap chain, image views, render pass, framebuffers, command pool, command buffers, semaphores, and fences. Each of these exists implicitly in OpenGLโ€”the driver manages them for you.

Learning milestones:

  1. OpenGL triangle renders โ†’ You understand the basic graphics pipeline
  2. Vulkan triangle renders โ†’ You understand explicit GPU control
  3. DX12 triangle renders โ†’ You understand Microsoftโ€™s low-level approach
  4. You can explain why Vulkan needs more code โ†’ Youโ€™ve internalized the abstraction trade-off

Project 2: Software Rasterizer โ€” The GPU on Your CPU

  • File: GRAPHICS_API_MASTERY_OPENGL_VULKAN_DIRECTX.md
  • Main Programming Language: C
  • Alternative Programming Languages: Rust, C++, Zig
  • Coolness Level: Level 4: Hardcore Tech Flex
  • Business Potential: 1. The โ€œResume Goldโ€
  • Difficulty: Level 3: Advanced
  • Knowledge Area: Computer Graphics / Rasterization
  • Software or Tool: Custom Rasterizer
  • Main Book: โ€œComputer Graphics from Scratchโ€ by Gabriel Gambetta

What youโ€™ll build: A complete software rasterizer that takes 3D triangles and draws them to a 2D pixel buffer, including perspective projection, depth buffering, and texture mappingโ€”all on the CPU.

Why it teaches Graphics APIs: You canโ€™t truly understand what OpenGL/Vulkan are doing until youโ€™ve built the pipeline yourself. Every GPU concept (depth buffer, texture sampling, fragment shaders) becomes crystal clear when you implement it in C.

Core challenges youโ€™ll face:

  • Perspective projection โ†’ Maps to vertex shader output
  • Triangle rasterization โ†’ Maps to rasterizer stage
  • Depth buffering โ†’ Maps to Z-buffer / depth test
  • Texture sampling โ†’ Maps to fragment shader texture access
  • Clipping โ†’ Maps to primitive clipping stage

Key Concepts:

  • Perspective Projection Math: โ€œComputer Graphics from Scratchโ€ Chapter 9 โ€” Gabriel Gambetta
  • Barycentric Coordinates: โ€œFundamentals of Computer Graphicsโ€ Chapter 8 โ€” Marschner & Shirley
  • Z-Buffer Algorithm: โ€œComputer Graphics: Principles and Practiceโ€ Chapter 8 โ€” Hughes et al.
  • Texture Mapping: โ€œReal-Time Renderingโ€ Chapter 6 โ€” Akenine-Mรถller et al.

Difficulty: Advanced Time estimate: 2-4 weeks Prerequisites: Linear algebra basics, Project 1 completed

Real world outcome:

$ ./software_rasterizer models/cube.obj textures/crate.png
# Opens window showing textured 3D cube rotating
# All rendering done on CPUโ€”no GPU calls!

$ ./software_rasterizer models/teapot.obj --wireframe
# Shows wireframe Utah teapot

# You can now explain EXACTLY what glDrawArrays() does internally

Implementation Hints: Start with 2D triangle filling using barycentric coordinates. Then add:

  1. Edge function: edge(v0, v1, p) = (p.x - v0.x)*(v1.y - v0.y) - (p.y - v0.y)*(v1.x - v0.x)
  2. Barycentric interpolation: For any point P inside triangle, compute weights (w0, w1, w2) where w0+w1+w2=1
  3. Depth buffer: Simple 2D array of floats, one per pixel
  4. Perspective-correct interpolation: Divide by Z before interpolating, multiply back after

Do NOT use any graphics library. Write directly to a pixel buffer and blit to screen using SDL2 or similar.

Learning milestones:

  1. 2D triangles fill correctly โ†’ You understand rasterization
  2. 3D cubes render with correct depth โ†’ You understand the Z-buffer
  3. Textures appear without distortion โ†’ You understand perspective-correct interpolation
  4. Performance is terrible compared to GPU โ†’ You understand why GPUs exist

Project 3: Shader Playground โ€” Live Shader Editor

  • File: GRAPHICS_API_MASTERY_OPENGL_VULKAN_DIRECTX.md
  • Main Programming Language: C++
  • Alternative Programming Languages: Rust, C, Python (with bindings)
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: 2. The โ€œMicro-SaaS / Pro Toolโ€
  • Difficulty: Level 2: Intermediate
  • Knowledge Area: Shader Programming / Hot-Reload
  • Software or Tool: OpenGL/GLSL
  • Main Book: โ€œOpenGL Shading Languageโ€ by Randi Rost

What youโ€™ll build: An interactive shader editor where you type GLSL code on one side, and see the results rendered in real-time on the other side. Save/load shaders, see compilation errors inline.

Why it teaches Graphics APIs: Shaders are where the magic happens. This project forces you to understand shader compilation, uniform binding, and the vertex/fragment shader relationship deeply.

Core challenges youโ€™ll face:

  • Shader hot-reloading โ†’ Maps to shader compilation pipeline
  • Error reporting with line numbers โ†’ Maps to GLSL compiler output parsing
  • Uniform management โ†’ Maps to CPU-GPU data transfer
  • Time/mouse uniforms โ†’ Maps to standard ShaderToy conventions
  • Multiple shader stages โ†’ Maps to pipeline configuration

Key Concepts:

  • GLSL Syntax & Semantics: โ€œOpenGL Shading Languageโ€ Chapters 2-4 โ€” Randi Rost
  • Uniform Variables: โ€œOpenGL Programming Guideโ€ Chapter 5 โ€” Shreiner et al.
  • Fragment Shader Techniques: โ€œThe Book of Shadersโ€ โ€” Patricio Gonzalez Vivo (online)
  • Shader Compilation: โ€œOpenGL Superbibleโ€ Chapter 6 โ€” Wright et al.

Difficulty: Intermediate Time estimate: 1-2 weeks Prerequisites: Project 1 (OpenGL part), basic OpenGL knowledge

Real world outcome:

# Your shader playground running:
# Left pane: code editor
# Right pane: live preview

// Type this in the editor, see plasma effect immediately:
void main() {
    vec2 uv = gl_FragCoord.xy / iResolution.xy;
    float t = iTime;
    vec3 col = 0.5 + 0.5*cos(t + uv.xyx + vec3(0,2,4));
    fragColor = vec4(col, 1.0);
}
# Errors show inline: "ERROR: 0:5: 'fragColor' : undeclared identifier"

Implementation Hints: Use a simple GUI library (Dear ImGui works great with OpenGL). The core loop:

  1. Watch shader file for changes (or check text buffer)
  2. Attempt recompilation with glCompileShader()
  3. Check GL_COMPILE_STATUS and get info log on failure
  4. If success, link program and swap with current
  5. Every frame: set uniforms (iTime, iResolution, iMouse), draw fullscreen quad

The fullscreen quad trick: Two triangles covering the screen, vertex shader passes through, fragment shader does all the work.

Learning milestones:

  1. Shaders compile and display โ†’ You understand the shader pipeline
  2. Errors show with line numbers โ†’ You understand GLSL compilation
  3. iTime makes things animate โ†’ You understand uniforms
  4. You recreate a ShaderToy effect โ†’ Youโ€™re thinking in parallel (per-pixel)

Project 4: Vulkan Multi-threaded Command Recorder

  • File: GRAPHICS_API_MASTERY_OPENGL_VULKAN_DIRECTX.md
  • Main Programming Language: C++
  • Alternative Programming Languages: Rust, C
  • Coolness Level: Level 4: Hardcore Tech Flex
  • Business Potential: 1. The โ€œResume Goldโ€
  • Difficulty: Level 4: Expert
  • Knowledge Area: Vulkan / Multi-threading / Command Buffers
  • Software or Tool: Vulkan API
  • Main Book: โ€œVulkan Programming Guideโ€ by Graham Sellers

What youโ€™ll build: A Vulkan renderer that records command buffers on multiple CPU threads in parallel, demonstrating Vulkanโ€™s core advantage over OpenGL.

Why it teaches Graphics APIs: This is THE reason Vulkan exists. OpenGL can only submit draw calls from one thread. Vulkan lets you record commands from N threads, then submit them all at once. This project makes you feel that difference.

Core challenges youโ€™ll face:

  • Command pool per thread โ†’ Maps to Vulkan threading model
  • Secondary command buffers โ†’ Maps to hierarchical command recording
  • Command buffer synchronization โ†’ Maps to queue submission
  • Load balancing across threads โ†’ Maps to parallel rendering architecture
  • Measuring actual speedup โ†’ Maps to profiling and validation

Key Concepts:

  • Vulkan Command Buffers: โ€œVulkan Programming Guideโ€ Chapter 6 โ€” Graham Sellers
  • Multi-threaded Rendering: โ€œVulkan Cookbookโ€ Chapter 9 โ€” Pawel Lapinski
  • Synchronization Primitives: โ€œVulkan Tutorialโ€ Rendering & Presentation โ€” vulkan-tutorial.com
  • Thread Pool Patterns: โ€œC++ Concurrency in Actionโ€ Chapter 9 โ€” Anthony Williams

Difficulty: Expert Time estimate: 2-3 weeks Prerequisites: Projects 1-3, solid Vulkan basics, multi-threading experience

Real world outcome:

$ ./vulkan_mt_renderer --threads 1 --objects 10000
Rendering 10000 objects with 1 thread
Frame time: 16.2ms (61 FPS)
Command buffer recording: 12.1ms

$ ./vulkan_mt_renderer --threads 8 --objects 10000
Rendering 10000 objects with 8 threads
Frame time: 6.8ms (147 FPS)
Command buffer recording: 2.1ms

# You've proven Vulkan's multi-threading advantage empirically!

Implementation Hints: Architecture:

  1. Main thread: Manages swap chain, submits primary command buffer
  2. Worker threads: Each has its own command pool, records secondary command buffers
  3. Frame structure: Divide objects among threads โ†’ each thread records draw calls โ†’ main thread executes secondary buffers

Critical Vulkan rules:

  • Command pools are NOT thread-safe; each thread needs its own
  • Secondary command buffers can be recorded in parallel
  • Use VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT carefully
  • Fences and semaphores for GPU-CPU synchronization

Learning milestones:

  1. Single-threaded Vulkan works โ†’ You have the foundation
  2. Multi-threaded recording works โ†’ You understand Vulkanโ€™s threading model
  3. You see 2-4x speedup โ†’ Youโ€™ve proven why Vulkan matters
  4. You can explain command pools โ†’ Youโ€™ve internalized Vulkanโ€™s design

Project 5: GPU Memory Allocator Visualizer

  • File: GRAPHICS_API_MASTERY_OPENGL_VULKAN_DIRECTX.md
  • Main Programming Language: C++
  • Alternative Programming Languages: Rust, C
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: 2. The โ€œMicro-SaaS / Pro Toolโ€
  • Difficulty: Level 3: Advanced
  • Knowledge Area: GPU Memory / Visualization
  • Software or Tool: Vulkan, Dear ImGui
  • Main Book: โ€œVulkan Cookbookโ€ by Pawel Lapinski

What youโ€™ll build: A visual tool that shows GPU memory heaps, allocation patterns, and memory type usage in real-time for a Vulkan application.

Why it teaches Graphics APIs: In Vulkan, YOU manage GPU memory. Thereโ€™s no magic driver allocating behind your back. This project forces you to understand memory types, heaps, and the CPU/GPU transfer model.

Core challenges youโ€™ll face:

  • Querying memory properties โ†’ Maps to physical device memory types
  • Visualizing heap fragmentation โ†’ Maps to allocation strategy impact
  • Tracking allocations โ†’ Maps to sub-allocation patterns
  • Understanding memory types โ†’ Maps to DEVICE_LOCAL vs HOST_VISIBLE
  • Mapping memory โ†’ Maps to CPU-GPU data transfer

Key Concepts:

  • Vulkan Memory Model: โ€œVulkan Programming Guideโ€ Chapter 2 โ€” Graham Sellers
  • Memory Allocation Strategies: VulkanMemoryAllocator (VMA) documentation โ€” AMD GPUOpen
  • Memory Heaps: โ€œVulkan Cookbookโ€ Chapter 2 โ€” Pawel Lapinski
  • Transfer Queues: โ€œVulkan Guideโ€ Memory chapter โ€” vkguide.dev

Difficulty: Advanced Time estimate: 2 weeks Prerequisites: Project 4, understanding of Vulkan memory

Real world outcome:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  GPU Memory Visualizer                                      โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Heap 0: DEVICE_LOCAL (8192 MB)                            โ”‚
โ”‚  [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 35% used (2867 MB)     โ”‚
โ”‚  โ”œโ”€โ”€ Textures: 1.2 GB                                       โ”‚
โ”‚  โ”œโ”€โ”€ Vertex Buffers: 800 MB                                 โ”‚
โ”‚  โ””โ”€โ”€ Framebuffers: 867 MB                                   โ”‚
โ”‚                                                             โ”‚
โ”‚  Heap 1: HOST_VISIBLE (16384 MB)                           โ”‚
โ”‚  [โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 12% used (1966 MB)     โ”‚
โ”‚  โ””โ”€โ”€ Staging Buffers: 1.9 GB                                โ”‚
โ”‚                                                             โ”‚
โ”‚  Live Allocation View:                                      โ”‚
โ”‚  [โ–“โ–“โ–“โ–“โ–‘โ–‘โ–‘โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–‘โ–‘โ–‘โ–‘โ–“โ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] (fragmentation: 23%)   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Implementation Hints: Use vkGetPhysicalDeviceMemoryProperties() to discover heaps and types. Hook into your allocation calls (or wrap VMA) to track:

  • Allocation size and type
  • Memory type index
  • Offset within heap
  • Usage flags

For visualization:

  • Dear ImGui for immediate mode GUI
  • Color-code by allocation type (textures=blue, buffers=green, etc.)
  • Show fragmentation as gaps in linear visualization

Learning milestones:

  1. Heap info displays correctly โ†’ You understand Vulkanโ€™s memory model
  2. Allocations appear as you create resources โ†’ Youโ€™re tracking memory flow
  3. You see fragmentation happen โ†’ You understand why sub-allocators matter
  4. You can explain HOST_VISIBLE vs DEVICE_LOCAL โ†’ You get CPU/GPU memory

Project 6: Compute Shader Mandelbrot with Zoom

  • File: GRAPHICS_API_MASTERY_OPENGL_VULKAN_DIRECTX.md
  • Main Programming Language: C++
  • Alternative Programming Languages: Rust, C
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: 1. The โ€œResume Goldโ€
  • Difficulty: Level 2: Intermediate
  • Knowledge Area: Compute Shaders / GPU Parallelism
  • Software or Tool: OpenGL or Vulkan Compute
  • Main Book: โ€œOpenGL Superbibleโ€ by Wright et al.

What youโ€™ll build: An interactive Mandelbrot set explorer where the fractal is computed entirely on the GPU using compute shaders. Zoom in infinitely (until precision limits).

Why it teaches Graphics APIs: Compute shaders show the GPUโ€™s true nature: a massively parallel processor. Each pixel is independent, making this embarrassingly parallel. Youโ€™ll understand workgroups, local size, and the compute pipeline.

Core challenges youโ€™ll face:

  • Compute shader basics โ†’ Maps to general-purpose GPU computing
  • Image storage binding โ†’ Maps to shader resource management
  • Workgroup sizing โ†’ Maps to GPU architecture (warps/wavefronts)
  • Double precision zoom โ†’ Maps to floating-point limits
  • Interactive parameter passing โ†’ Maps to uniform/push constant usage

Key Concepts:

  • Compute Shaders: โ€œOpenGL Superbibleโ€ Chapter 12 โ€” Wright et al.
  • GPU Workgroups: โ€œGPU Gems 3โ€ Chapter 31 โ€” NVIDIA
  • Mandelbrot Algorithm: โ€œComputer Graphics from Scratchโ€ Appendix โ€” Gabriel Gambetta
  • Image Load/Store: โ€œOpenGL Shading Languageโ€ Chapter 7 โ€” Randi Rost

Difficulty: Intermediate Time estimate: 1 week Prerequisites: Project 3 (shader basics)

Real world outcome:

# Launch the Mandelbrot explorer
$ ./mandelbrot_compute

# Use mouse wheel to zoom, click to recenter
# Watch the GPU compute millions of iterations in real-time
# Zoom to 10^-14 and see the fractal detail
# Console shows: "Computing 1920x1080 = 2M pixels @ 1000 iterations: 2.3ms"

# Compare with CPU version: same computation takes 850ms
# That's 370x faster on GPU!

Implementation Hints: Compute shader structure:

layout(local_size_x = 16, local_size_y = 16) in;
layout(rgba8, binding = 0) writeonly uniform image2D outImage;

uniform dvec2 center;  // Use double for precision
uniform double zoom;
uniform int maxIter;

void main() {
    ivec2 pixel = ivec2(gl_GlobalInvocationID.xy);
    // Map pixel to complex plane using center/zoom
    // Iterate z = zยฒ + c
    // Color based on escape iteration
    imageStore(outImage, pixel, color);
}

Dispatch with: glDispatchCompute(width/16, height/16, 1)

Use 16x16 workgroups (256 threads) to match GPU warp/wavefront size.

Learning milestones:

  1. Static Mandelbrot renders โ†’ You understand compute shaders
  2. Zooming works smoothly โ†’ You understand uniform updates
  3. Performance is 100x+ faster than CPU โ†’ You understand GPU parallelism
  4. You hit precision limits โ†’ You understand floating-point in shaders

Project 7: Frame Timing Profiler

  • File: GRAPHICS_API_MASTERY_OPENGL_VULKAN_DIRECTX.md
  • Main Programming Language: C++
  • Alternative Programming Languages: Rust, C
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: 3. The โ€œService & Supportโ€ Model
  • Difficulty: Level 3: Advanced
  • Knowledge Area: Performance Profiling / GPU Timing
  • Software or Tool: OpenGL/Vulkan Timer Queries
  • Main Book: โ€œReal-Time Renderingโ€ by Akenine-Mรถller et al.

What youโ€™ll build: A profiling overlay that measures GPU time for each render pass, shows CPU/GPU sync points, and identifies bottlenecks in real-time.

Why it teaches Graphics APIs: Understanding performance requires understanding the GPU timeline. This project teaches you GPU queries, async readback, and the fundamental CPU/GPU relationship.

Core challenges youโ€™ll face:

  • GPU timer queries โ†’ Maps to asynchronous GPU measurement
  • Query latency handling โ†’ Maps to GPU/CPU async relationship
  • Pipeline statistics โ†’ Maps to GPU stage utilization
  • Overlay rendering โ†’ Maps to render pass ordering
  • Identifying bottlenecks โ†’ Maps to CPU-bound vs GPU-bound

Key Concepts:

  • Timer Queries: โ€œOpenGL Superbibleโ€ Chapter 11 โ€” Wright et al.
  • Vulkan Timestamp Queries: โ€œVulkan Programming Guideโ€ Chapter 7 โ€” Graham Sellers
  • Performance Analysis: โ€œReal-Time Renderingโ€ Chapter 18 โ€” Akenine-Mรถller et al.
  • GPU Pipeline Stages: โ€œGPU Gems 2โ€ Chapter 2 โ€” NVIDIA

Difficulty: Advanced Time estimate: 2 weeks Prerequisites: Projects 1-3, understanding of render passes

Real world outcome:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Frame Profiler                                    16.6ms   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ CPU Timeline:                                              โ”‚
โ”‚ [Updateโ–ˆโ–ˆโ–ˆโ–ˆ|Recordโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ|Submitโ–ˆ|Waitโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]   โ”‚
โ”‚   2.1ms      4.2ms        0.3ms   10.0ms (GPU bottleneck!)  โ”‚
โ”‚                                                             โ”‚
โ”‚ GPU Timeline:                                              โ”‚
โ”‚ [Shadowโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ|GBufferโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ|Lightโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ|Postโ–ˆโ–ˆโ–ˆ]       โ”‚
โ”‚     3.2ms          4.8ms          3.1ms      1.2ms         โ”‚
โ”‚                                                             โ”‚
โ”‚ Bottleneck: GPU-bound (shadow pass taking 3.2ms)           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Implementation Hints: OpenGL approach:

  1. Create query objects: glGenQueries(N, queries)
  2. Before pass: glQueryCounter(queries[start], GL_TIMESTAMP)
  3. After pass: glQueryCounter(queries[end], GL_TIMESTAMP)
  4. Next frame: glGetQueryObjectui64v() to read results (latency!)

Key insight: GPU queries return results 1-3 frames later. You need a ring buffer of queries and must handle the async nature.

For CPU timing, use std::chrono::high_resolution_clock around key sections.

Learning milestones:

  1. GPU timings display โ†’ You understand timer queries
  2. Latency is handled correctly โ†’ You understand async GPU readback
  3. You identify a real bottleneck โ†’ You can optimize rendering
  4. You explain CPU vs GPU bound โ†’ You understand the parallel timeline

Project 8: 3D Model Viewer with PBR Materials

  • File: GRAPHICS_API_MASTERY_OPENGL_VULKAN_DIRECTX.md
  • Main Programming Language: C++
  • Alternative Programming Languages: Rust, C
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: 2. The โ€œMicro-SaaS / Pro Toolโ€
  • Difficulty: Level 3: Advanced
  • Knowledge Area: 3D Rendering / PBR / Model Loading
  • Software or Tool: OpenGL or Vulkan, Assimp
  • Main Book: โ€œReal-Time Renderingโ€ by Akenine-Mรถller et al.

What youโ€™ll build: A 3D model viewer that loads glTF/OBJ files and renders them with physically-based materials (metalness, roughness, normal maps).

Why it teaches Graphics APIs: This combines all the pieces: model loading, texture management, shader complexity, and multiple render targets. PBR forces you to understand the full fragment shader pipeline.

Core challenges youโ€™ll face:

  • Model loading (glTF/OBJ) โ†’ Maps to buffer management and layouts
  • Multiple textures per material โ†’ Maps to texture binding and samplers
  • PBR shader implementation โ†’ Maps to complex fragment shaders
  • Normal mapping โ†’ Maps to tangent space calculations
  • HDR environment lighting โ†’ Maps to image-based lighting

Key Concepts:

  • glTF Format: โ€œglTF 2.0 Specificationโ€ โ€” Khronos Group
  • PBR Theory: โ€œReal-Time Renderingโ€ Chapter 9 โ€” Akenine-Mรถller et al.
  • Image-Based Lighting: โ€œGPU Gemsโ€ Chapter 10 โ€” NVIDIA
  • Normal Mapping: โ€œOpenGL Shading Languageโ€ Chapter 8 โ€” Randi Rost

Difficulty: Advanced Time estimate: 3-4 weeks Prerequisites: Projects 1-3, linear algebra comfort

Real world outcome:

$ ./pbr_viewer models/damaged_helmet.glb --env hdri/studio.hdr

# Interactive 3D viewer showing:
# - Shiny metal helmet with scratches
# - Accurate reflections from environment
# - Normal-mapped surface detail
# - Orbit camera with mouse

# Material panel shows: Metalness=1.0, Roughness=0.3
# Drag slider to see how roughness affects reflection blur

Implementation Hints: PBR core equations (Cook-Torrance BRDF):

  • D (Distribution): GGX/Trowbridge-Reitz for specular highlight shape
  • G (Geometry): Smithโ€™s method for self-shadowing
  • F (Fresnel): Schlick approximation for angle-dependent reflection

Use Assimp library for model loading. For each mesh:

  1. Extract vertices, normals, tangents, UVs
  2. Load associated textures (albedo, metallic-roughness, normal, AO)
  3. Create GPU buffers and bind textures

Environment lighting: Pre-filter the HDR cubemap for different roughness levels.

Learning milestones:

  1. Models load and display โ†’ You understand vertex buffer layouts
  2. Textures apply correctly โ†’ You understand texture binding
  3. PBR looks realistic โ†’ You understand the BRDF
  4. Environment reflections work โ†’ You understand IBL

Project 9: Deferred Renderer with G-Buffer

  • File: GRAPHICS_API_MASTERY_OPENGL_VULKAN_DIRECTX.md
  • Main Programming Language: C++
  • Alternative Programming Languages: Rust, C
  • Coolness Level: Level 4: Hardcore Tech Flex
  • Business Potential: 1. The โ€œResume Goldโ€
  • Difficulty: Level 4: Expert
  • Knowledge Area: Deferred Rendering / Multiple Render Targets
  • Software or Tool: OpenGL or Vulkan
  • Main Book: โ€œReal-Time Renderingโ€ by Akenine-Mรถller et al.

What youโ€™ll build: A deferred renderer that writes geometry data to multiple textures (G-Buffer), then performs lighting in screen-spaceโ€”enabling hundreds of lights efficiently.

Why it teaches Graphics APIs: Deferred rendering requires multiple render targets, framebuffer objects, and screen-space techniques. Itโ€™s how modern games handle complex lighting.

Core challenges youโ€™ll face:

  • Multiple render targets โ†’ Maps to framebuffer configuration
  • G-Buffer layout design โ†’ Maps to texture format choices
  • Geometry pass โ†’ Maps to first render pass structure
  • Lighting pass โ†’ Maps to full-screen quad techniques
  • Many lights โ†’ Maps to light volume optimization

Key Concepts:

  • Deferred Shading: โ€œReal-Time Renderingโ€ Chapter 20 โ€” Akenine-Mรถller et al.
  • Framebuffer Objects: โ€œOpenGL Superbibleโ€ Chapter 9 โ€” Wright et al.
  • G-Buffer Formats: โ€œGPU Pro 5โ€ Chapter 1 โ€” Wolfgang Engel
  • Light Volumes: โ€œGPU Gems 2โ€ Chapter 9 โ€” NVIDIA

Difficulty: Expert Time estimate: 3-4 weeks Prerequisites: Project 8, solid shader knowledge

Real world outcome:

# Deferred renderer running with 500 point lights
$ ./deferred_renderer --lights 500

# G-Buffer visualization mode (press 1-5):
# 1: Albedo (diffuse color)
# 2: World-space normals
# 3: Depth (linearized)
# 4: Metallic/Roughness
# 5: Final lit result

# FPS counter shows: 60 FPS with 500 lights
# (Forward renderer would be ~10 FPS)

Implementation Hints: G-Buffer layout (common setup):

  • RT0: RGB=Albedo, A=Metallic
  • RT1: RGB=World Normal (encoded), A=Roughness
  • RT2: Depth (from depth buffer)

Two-pass architecture:

  1. Geometry Pass: Render scene to G-Buffer, output material properties per pixel
  2. Lighting Pass: For each light, read G-Buffer, compute lighting, accumulate

Optimization: Use light volumes (spheres for point lights) to only shade affected pixels.

Learning milestones:

  1. G-Buffer displays correctly โ†’ You understand MRT
  2. Single light works โ†’ You understand screen-space lighting
  3. Hundreds of lights at 60fps โ†’ You understand why deferred wins
  4. You can explain forward vs deferred โ†’ Youโ€™ve internalized the trade-offs

Project 10: Particle System with GPU Simulation

  • File: GRAPHICS_API_MASTERY_OPENGL_VULKAN_DIRECTX.md
  • Main Programming Language: C++
  • Alternative Programming Languages: Rust, C
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: 2. The โ€œMicro-SaaS / Pro Toolโ€
  • Difficulty: Level 3: Advanced
  • Knowledge Area: Compute Shaders / Instanced Rendering
  • Software or Tool: OpenGL or Vulkan Compute
  • Main Book: โ€œGPU Gems 3โ€ โ€” NVIDIA

What youโ€™ll build: A million-particle system where physics simulation runs on GPU compute shaders and rendering uses instancingโ€”all with zero CPU particle updates.

Why it teaches Graphics APIs: This bridges compute and graphics. Youโ€™ll learn buffer sharing between compute and render, GPU atomics, and the power of instanced drawing.

Core challenges youโ€™ll face:

  • GPU particle simulation โ†’ Maps to compute shader physics
  • Buffer sharing โ†’ Maps to compute-graphics interop
  • Instanced rendering โ†’ Maps to reducing draw calls
  • Particle emission/death โ†’ Maps to GPU atomics and counters
  • Sorting for transparency โ†’ Maps to GPU sorting algorithms

Key Concepts:

  • GPU Particle Systems: โ€œGPU Gems 3โ€ Chapter 23 โ€” NVIDIA
  • Instanced Rendering: โ€œOpenGL Superbibleโ€ Chapter 7 โ€” Wright et al.
  • Compute-Graphics Sync: โ€œVulkan Programming Guideโ€ Chapter 6 โ€” Graham Sellers
  • GPU Sorting: โ€œGPU Gems 2โ€ Chapter 46 โ€” NVIDIA

Difficulty: Advanced Time estimate: 2-3 weeks Prerequisites: Project 6 (compute shaders), Project 1

Real world outcome:

$ ./gpu_particles --count 1000000

# Window shows 1 million particles simulating at 60fps
# Click to spawn explosions, particles have gravity/wind
# Console: "Simulating 1M particles: compute=0.8ms, render=0.4ms"

# Compare: CPU particle system caps at ~50,000 particles
# GPU version handles 20x more with less frame time!

Implementation Hints: Data structures (GPU buffers):

  • Position buffer: vec4 positions[N]
  • Velocity buffer: vec4 velocities[N]
  • Life buffer: float lives[N]

Compute shader updates each particle in parallel:

velocity += gravity * dt;
position += velocity * dt;
life -= dt;
if (life <= 0) { respawn(); }

Render with instanced draw:

  • Single triangle/quad geometry
  • Instance ID indexes into position buffer
  • Vertex shader reads positions[gl_InstanceID]

Learning milestones:

  1. Particles spawn and fall โ†’ You understand GPU simulation
  2. Million particles run smoothly โ†’ You understand GPU parallelism
  3. Explosions work โ†’ You understand GPU atomics
  4. Soft particles render โ†’ You understand depth buffer tricks

Project 11: Cross-API Abstraction Layer

  • File: GRAPHICS_API_MASTERY_OPENGL_VULKAN_DIRECTX.md
  • Main Programming Language: C++
  • Alternative Programming Languages: Rust, C
  • Coolness Level: Level 4: Hardcore Tech Flex
  • Business Potential: 4. The โ€œOpen Coreโ€ Infrastructure
  • Difficulty: Level 4: Expert
  • Knowledge Area: Graphics Abstraction / API Design
  • Software or Tool: OpenGL + Vulkan + DX12
  • Main Book: โ€œGame Engine Architectureโ€ by Jason Gregory

What youโ€™ll build: A thin abstraction layer that provides a unified interface over OpenGL, Vulkan, and DirectX 12โ€”like a mini-BGFX or SDL_GPU.

Why it teaches Graphics APIs: By building an abstraction, you must deeply understand whatโ€™s common and whatโ€™s different. Youโ€™ll find the โ€œlowest common denominatorโ€ of GPU operations.

Core challenges youโ€™ll face:

  • Identifying common concepts โ†’ Maps to graphics API design space
  • Handle management โ†’ Maps to resource lifecycle differences
  • Shader translation โ†’ Maps to GLSL vs HLSL vs SPIR-V
  • Command buffer abstraction โ†’ Maps to immediate vs deferred
  • Sync primitive mapping โ†’ Maps to fences/semaphores across APIs

Key Concepts:

  • Graphics Abstraction Design: โ€œGame Engine Architectureโ€ Chapter 11 โ€” Jason Gregory
  • BGFX Design Philosophy: bgfx documentation โ€” Branimir Karadลพiฤ‡
  • WebGPU Specification: W3C WebGPU Standard โ€” WebGPU Working Group
  • SDL_GPU Design: SDL3 GPU Documentation โ€” libsdl.org

Difficulty: Expert Time estimate: 1-2 months Prerequisites: All previous projects, deep API knowledge

Real world outcome:

// Your abstraction in action:
auto device = gfx::CreateDevice(gfx::Backend::Vulkan);
auto buffer = device->CreateBuffer({1024, gfx::BufferUsage::Vertex});
auto shader = device->CreateShader("triangle.glsl");
auto pipeline = device->CreatePipeline(shader, layout);

// Render loop (same code, any backend):
auto cmd = device->BeginFrame();
cmd->BeginRenderPass(backbuffer);
cmd->BindPipeline(pipeline);
cmd->Draw(3);
cmd->EndRenderPass();
device->EndFrame();

// Switch backend by changing one line:
// gfx::Backend::Vulkan โ†’ gfx::Backend::OpenGL โ†’ gfx::Backend::DX12

Implementation Hints: Start with the narrowest scope:

  1. Device creation (instance, adapter, device)
  2. Buffer creation and upload
  3. Shader loading (compile GLSL to SPIR-V, SPIR-V to HLSL)
  4. Simple pipeline (vertex format, shader, blend state)
  5. Draw commands (bind, draw, present)

Use compile-time backend selection initially. Runtime switching is much harder.

Key abstraction decisions:

  • Do you expose command buffers or hide them?
  • How do you handle pipeline state (monolithic or partial)?
  • Do you translate shaders or require multiple versions?

Study BGFX, Dawn (WebGPU), and SDL_GPU for inspiration.

Learning milestones:

  1. Triangle renders on 2 backends โ†’ You found the common API
  2. Same demo runs on all 3 โ†’ You understand the differences deeply
  3. You make hard trade-off decisions โ†’ Youโ€™re thinking like an API designer
  4. Someone else can use your abstraction โ†’ Youโ€™ve created something useful

Project 12: Texture Streaming System

  • File: GRAPHICS_API_MASTERY_OPENGL_VULKAN_DIRECTX.md
  • Main Programming Language: C++
  • Alternative Programming Languages: Rust, C
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: 3. The โ€œService & Supportโ€ Model
  • Difficulty: Level 3: Advanced
  • Knowledge Area: Memory Management / Async Loading
  • Software or Tool: Vulkan (preferred for explicit memory)
  • Main Book: โ€œGPU Pro 7โ€ โ€” Wolfgang Engel

What youโ€™ll build: A system that streams texture mip levels on demand, loading high-resolution textures only when the camera gets closeโ€”like virtual texturing in games.

Why it teaches Graphics APIs: This combines async file I/O, staging buffers, transfer queues, and mipmap management. Itโ€™s how AAA games handle gigabytes of textures.

Core challenges youโ€™ll face:

  • Mipmap streaming logic โ†’ Maps to LOD and texture management
  • Async upload via staging โ†’ Maps to transfer queue usage
  • Memory budgeting โ†’ Maps to GPU memory limits
  • Placeholder/fallback mips โ†’ Maps to visual continuity
  • Priority queue for loading โ†’ Maps to resource scheduling

Key Concepts:

  • Virtual Texturing: โ€œGPU Pro 5โ€ Chapter 2 โ€” Wolfgang Engel
  • Transfer Queues: โ€œVulkan Cookbookโ€ Chapter 3 โ€” Pawel Lapinski
  • Mipmap Streaming: id Software Technical Publications โ€” John Carmack
  • Async Resource Loading: โ€œGame Engine Architectureโ€ Chapter 8 โ€” Jason Gregory

Difficulty: Advanced Time estimate: 3 weeks Prerequisites: Project 5 (memory management)

Real world outcome:

$ ./texture_streamer scene_with_4k_textures/

# Walk around 3D scene
# Console shows streaming activity:
# [STREAM] Loading rock_4k.dds mip 0 (4096x4096) - priority: HIGH
# [STREAM] Uploading 16MB to GPU...
# [STREAM] Complete. GPU memory: 1.2GB / 8GB

# As you walk away, high mips are evicted:
# [EVICT] rock_4k mip 0 (not visible, memory pressure)

# Visualize mip levels: Press M
# Screen shows color-coded: red=mip0, green=mip2, blue=mip4

Implementation Hints: Architecture:

  1. Visibility pass: Render with minimum mips, record whatโ€™s needed
  2. Priority queue: Sort by (screen coverage ร— distance ร— time-since-request)
  3. Async loader thread: Read from disk, decompress
  4. Upload thread: Copy to staging buffer, record transfer command
  5. Main thread: Submit transfer, update texture bindings

Vulkan-specific: Use a dedicated transfer queue if available. Staging buffer pool to avoid allocation overhead.

Fallback strategy: Always keep mip N-2 or lower resident. Stream higher mips on demand.

Learning milestones:

  1. Mips load on approach โ†’ You understand streaming logic
  2. Memory stays within budget โ†’ You understand eviction
  3. No visible pop-in โ†’ You understand async timing
  4. You handle 10GB of textures โ†’ Youโ€™ve built a production system

Project 13: Real-Time Ray Tracer (RTX/DXR)

  • File: GRAPHICS_API_MASTERY_OPENGL_VULKAN_DIRECTX.md
  • Main Programming Language: C++
  • Alternative Programming Languages: Rust
  • Coolness Level: Level 5: Pure Magic (Super Cool)
  • Business Potential: 1. The โ€œResume Goldโ€
  • Difficulty: Level 4: Expert
  • Knowledge Area: Ray Tracing / RTX Extensions
  • Software or Tool: Vulkan Ray Tracing, DXR
  • Main Book: โ€œRay Tracing Gemsโ€ โ€” Akenine-Mรถller et al.

What youโ€™ll build: A real-time ray tracer using hardware RTX acceleration, featuring reflections, shadows, and global illumination.

Why it teaches Graphics APIs: Ray tracing extensions are the newest addition to graphics APIs. Youโ€™ll learn acceleration structures, ray generation shaders, and how hardware ray tracing works.

Core challenges youโ€™ll face:

  • Acceleration structure building โ†’ Maps to BVH construction
  • Ray tracing pipeline โ†’ Maps to shader binding tables
  • Ray generation shader โ†’ Maps to camera rays
  • Closest hit/miss shaders โ†’ Maps to material handling
  • Denoising โ†’ Maps to temporal accumulation

Key Concepts:

  • RTX Architecture: โ€œRay Tracing Gemsโ€ Chapter 1 โ€” NVIDIA
  • Vulkan Ray Tracing: โ€œVulkan Ray Tracing Tutorialโ€ โ€” NVIDIA
  • Acceleration Structures: โ€œRay Tracing Gemsโ€ Chapter 2 โ€” NVIDIA
  • Denoising: โ€œRay Tracing Gems IIโ€ Chapter 32 โ€” NVIDIA

Difficulty: Expert Time estimate: 1 month Prerequisites: Project 8-9, RTX-capable GPU

Real world outcome:

$ ./rtx_renderer cornell_box.gltf

# Window shows Cornell Box with:
# - Mirror-perfect reflections on metal sphere
# - Soft shadows from area light
# - Color bleeding (red/green walls onto white floor)
# - 60 FPS at 1080p on RTX 3070

# Press R for rasterized comparison: flat, fake lighting
# Press T for ray-traced: physically accurate

Implementation Hints: Vulkan ray tracing setup:

  1. Enable VK_KHR_ray_tracing_pipeline and VK_KHR_acceleration_structure
  2. Build BLAS (per-mesh) and TLAS (scene-wide)
  3. Create ray tracing pipeline with RayGen, ClosestHit, Miss shaders
  4. Create shader binding table (SBT)
  5. Dispatch rays with vkCmdTraceRaysKHR()

Start simple: Primary rays only, no bounces. Then add:

  • Shadow rays (point light)
  • Reflection rays (1 bounce)
  • Path tracing (many bounces, needs denoising)

Learning milestones:

  1. Primary rays show scene โ†’ You understand the RT pipeline
  2. Shadows work โ†’ You understand any-hit queries
  3. Reflections work โ†’ You understand recursive rays
  4. Path traced GI โ†’ You understand Monte Carlo integration
  5. Denoised result is clean โ†’ Youโ€™ve built a complete RT renderer

Project 14: Post-Processing Pipeline

  • File: GRAPHICS_API_MASTERY_OPENGL_VULKAN_DIRECTX.md
  • Main Programming Language: C++
  • Alternative Programming Languages: Rust, C
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: 2. The โ€œMicro-SaaS / Pro Toolโ€
  • Difficulty: Level 2: Intermediate
  • Knowledge Area: Post-Processing / Image Effects
  • Software or Tool: OpenGL or Vulkan
  • Main Book: โ€œGPU Gemsโ€ โ€” NVIDIA

What youโ€™ll build: A composable post-processing system with effects like bloom, tone mapping, FXAA, depth of field, and screen-space ambient occlusion.

Why it teaches Graphics APIs: Post-processing is all about render-to-texture, ping-pong buffers, and full-screen shader techniques. Itโ€™s essential for any polished renderer.

Core challenges youโ€™ll face:

  • Render-to-texture setup โ†’ Maps to framebuffer configuration
  • Ping-pong buffering โ†’ Maps to multi-pass rendering
  • HDR pipeline โ†’ Maps to floating-point textures
  • Effect ordering โ†’ Maps to dependency management
  • Performance tuning โ†’ Maps to resolution scaling

Key Concepts:

  • HDR Rendering: โ€œGPU Gemsโ€ Chapter 28 โ€” NVIDIA
  • Bloom: โ€œGPU Gemsโ€ Chapter 21 โ€” NVIDIA
  • FXAA: โ€œFXAA White Paperโ€ โ€” Timothy Lottes (NVIDIA)
  • SSAO: โ€œGPU Gems 3โ€ Chapter 12 โ€” NVIDIA

Difficulty: Intermediate Time estimate: 2 weeks Prerequisites: Project 3, framebuffer basics

Real world outcome:

$ ./post_fx_demo scene.gltf

# Real-time controls (Dear ImGui):
# [x] Bloom         Threshold: 1.0  Intensity: 0.5
# [x] Tone Mapping  Exposure: 1.2   Mode: ACES
# [x] FXAA          Quality: High
# [ ] DOF           Focus: 10m      Aperture: f/2.8
# [x] Vignette      Intensity: 0.3

# Toggle each effect to see before/after
# Performance overlay: "Post-FX total: 2.1ms"

Implementation Hints: Pipeline structure:

  1. Render scene to HDR framebuffer (RGBA16F)
  2. Bright pass: Extract pixels > threshold
  3. Blur passes: Gaussian blur on bright (multiple scales)
  4. Combine: Add blur back to HDR
  5. Tone map: HDR โ†’ LDR (Reinhard, ACES, etc.)
  6. FXAA: Edge detection and smoothing
  7. Output to screen

Use a framebuffer pool: allocate common sizes upfront, reuse across frames.

Effect chain abstraction:

class PostEffect {
    virtual void Apply(Texture* input, Texture* output) = 0;
};

Learning milestones:

  1. Render-to-texture works โ†’ You understand offscreen rendering
  2. Bloom makes lights glow โ†’ You understand multi-pass blur
  3. HDR looks better than LDR โ†’ You understand dynamic range
  4. Effects are composable โ†’ Youโ€™ve built a production system

Project 15: Vulkan vs OpenGL Benchmark Suite

  • File: GRAPHICS_API_MASTERY_OPENGL_VULKAN_DIRECTX.md
  • Main Programming Language: C++
  • Alternative Programming Languages: C, Rust
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: 2. The โ€œMicro-SaaS / Pro Toolโ€
  • Difficulty: Level 3: Advanced
  • Knowledge Area: Performance Testing / API Comparison
  • Software or Tool: OpenGL + Vulkan
  • Main Book: โ€œReal-Time Renderingโ€ by Akenine-Mรถller et al.

What youโ€™ll build: A benchmark suite that runs identical rendering workloads on both OpenGL and Vulkan, measuring and comparing CPU overhead, GPU time, and multi-threading scaling.

Why it teaches Graphics APIs: Theory says Vulkan should be faster. This project makes you prove itโ€”and understand exactly when and why each API wins.

Core challenges youโ€™ll face:

  • Identical workloads โ†’ Maps to fair comparison methodology
  • Draw call scaling โ†’ Maps to driver overhead measurement
  • Thread scaling tests โ†’ Maps to multi-threading differences
  • GPU timing precision โ†’ Maps to timer query usage
  • Statistical validity โ†’ Maps to benchmark methodology

Key Concepts:

  • Benchmark Methodology: โ€œReal-Time Renderingโ€ Chapter 18 โ€” Akenine-Mรถller et al.
  • Driver Overhead: AMD & NVIDIA GDC Presentations โ€” Various
  • Performance Counters: โ€œOpenGL Insightsโ€ Chapter 18 โ€” Cozzi & Riccio
  • Multi-threading Analysis: โ€œVulkan Cookbookโ€ Chapter 11 โ€” Pawel Lapinski

Difficulty: Advanced Time estimate: 2-3 weeks Prerequisites: Projects 1 and 4 (both APIs)

Real world outcome:

$ ./api_benchmark --test all

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                     API BENCHMARK RESULTS                         โ•‘
โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
โ•‘ Test                    โ”‚ OpenGL    โ”‚ Vulkan    โ”‚ Winner         โ•‘
โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
โ•‘ Single Triangle         โ”‚ 9823 FPS  โ”‚ 7654 FPS  โ”‚ OpenGL (+28%)  โ•‘
โ•‘ 100 Draw Calls          โ”‚ 4521 FPS  โ”‚ 4892 FPS  โ”‚ Vulkan (+8%)   โ•‘
โ•‘ 1000 Draw Calls         โ”‚ 876 FPS   โ”‚ 2341 FPS  โ”‚ Vulkan (+167%) โ•‘
โ•‘ 10000 Draw Calls        โ”‚ 94 FPS    โ”‚ 312 FPS   โ”‚ Vulkan (+232%) โ•‘
โ•‘ 1000 DC (4 threads)     โ”‚ 854 FPS   โ”‚ 4102 FPS  โ”‚ Vulkan (+380%) โ•‘
โ•‘ Texture Upload (100MB)  โ”‚ 125ms     โ”‚ 98ms      โ”‚ Vulkan (+28%)  โ•‘
โ•‘ Compute (1M elements)   โ”‚ 2.3ms     โ”‚ 2.1ms     โ”‚ Vulkan (+10%)  โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

Conclusion: Vulkan advantage increases with draw call count and thread count.
OpenGL wins for minimal workloads due to lower setup overhead.

Implementation Hints: Benchmark structure:

  1. Warm-up phase: Run for 2 seconds, discard results
  2. Measurement phase: Run for 10 seconds, collect samples
  3. Statistics: Report mean, std dev, min, max, 99th percentile

Key tests:

  • Draw call scaling: N objects, 1 draw call each
  • Batch scaling: N objects, 1 draw call total (instancing)
  • Thread scaling: Record commands on 1, 2, 4, 8 threads
  • Memory throughput: Upload buffers/textures of varying sizes

Critical: Ensure GPU is actually doing work (donโ€™t let driver optimize away empty draws).

Learning milestones:

  1. Same visual output from both โ†’ Fair comparison
  2. Numbers match expectations โ†’ Valid methodology
  3. You find the crossover point โ†’ You understand when Vulkan wins
  4. You can explain results โ†’ Youโ€™ve internalized API differences

Project 16: GPU Profiler with Flame Graph

  • File: GRAPHICS_API_MASTERY_OPENGL_VULKAN_DIRECTX.md
  • Main Programming Language: C++
  • Alternative Programming Languages: Rust
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: 3. The โ€œService & Supportโ€ Model
  • Difficulty: Level 3: Advanced
  • Knowledge Area: GPU Profiling / Visualization
  • Software or Tool: Vulkan or OpenGL, Dear ImGui
  • Main Book: โ€œReal-Time Renderingโ€ by Akenine-Mรถller et al.

What youโ€™ll build: An in-engine profiler that displays GPU workload as an interactive flame graph, showing hierarchical timing of render passes and draw calls.

Why it teaches Graphics APIs: This forces deep understanding of GPU timelines, query pools, and the async nature of GPU execution.

Core challenges youโ€™ll face:

  • Hierarchical timing โ†’ Maps to nested query regions
  • Query pool management โ†’ Maps to resource pooling
  • Flame graph rendering โ†’ Maps to data visualization
  • Async result handling โ†’ Maps to GPU-CPU latency
  • Minimal overhead โ†’ Maps to profiling without skewing results

Key Concepts:

  • GPU Queries: โ€œOpenGL Superbibleโ€ Chapter 11 โ€” Wright et al.
  • Flame Graphs: Brendan Greggโ€™s Flame Graph work
  • Profiling Best Practices: RenderDoc documentation
  • Query Pools: โ€œVulkan Programming Guideโ€ Chapter 7 โ€” Graham Sellers

Difficulty: Advanced Time estimate: 2 weeks Prerequisites: Project 7

Real world outcome:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  GPU Flame Graph (16.2ms frame)                                 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ”‚
โ”‚ Frame (16.2ms)                                                  โ”‚
โ”‚ โ”œโ”€โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ โ”‚
โ”‚ โ”‚ ShadowPass (3.8ms)                                           โ”‚
โ”‚ โ”‚ โ”œโ”€โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ DrawStaticMeshes (2.1ms)                            โ”‚
โ”‚ โ”‚ โ””โ”€โ–ˆโ–ˆโ–ˆ DrawSkinnedMeshes (0.9ms)                              โ”‚
โ”‚ โ”œโ”€โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ โ”‚
โ”‚ โ”‚       GBufferPass (4.2ms)                                    โ”‚
โ”‚ โ””โ”€โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ”‚
โ”‚                             LightingPass (5.1ms) โ† BOTTLENECK!  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
Click to expand/collapse. Hover for details.

Implementation Hints: Data model:

struct ProfileZone {
    string name;
    uint64_t startQuery, endQuery;
    vector<ProfileZone> children;
};

Query management:

  • Pre-allocate query pool (e.g., 1024 queries)
  • Ring buffer for frame-to-frame query reuse
  • Results are 2-3 frames old (handle latency)

Flame graph rendering:

  • Each zone is a rect: width = duration, x = start time
  • Stack depth determines y position
  • Color by category (shadow=gray, lighting=yellow, etc.)

Learning milestones:

  1. Timings appear โ†’ You understand GPU queries
  2. Hierarchy works โ†’ You understand nested profiling
  3. Flame graph renders โ†’ You can visualize complex data
  4. You find a real bottleneck โ†’ Youโ€™ve built a useful tool

Project 17: Immediate Mode Debug Renderer

  • File: GRAPHICS_API_MASTERY_OPENGL_VULKAN_DIRECTX.md
  • Main Programming Language: C++
  • Alternative Programming Languages: C, Rust
  • Coolness Level: Level 2: Practical but Forgettable
  • Business Potential: 2. The โ€œMicro-SaaS / Pro Toolโ€
  • Difficulty: Level 2: Intermediate
  • Knowledge Area: Debug Visualization / Retained vs Immediate
  • Software or Tool: OpenGL or Vulkan
  • Main Book: โ€œGame Engine Architectureโ€ by Jason Gregory

What youโ€™ll build: A debug drawing system where you can call debug.DrawLine(), debug.DrawSphere(), etc. from anywhere in code, and it renders at end of frame.

Why it teaches Graphics APIs: This explores the tension between immediate-mode API (easy to use) and retained-mode GPU (efficient). Youโ€™ll batch dynamic geometry efficiently.

Core challenges youโ€™ll face:

  • Dynamic vertex buffer โ†’ Maps to buffer streaming
  • Batching by primitive type โ†’ Maps to draw call reduction
  • Persistent lines โ†’ Maps to frame-to-frame state
  • Depth testing options โ†’ Maps to pipeline state
  • Thread-safe command queue โ†’ Maps to deferred submission

Key Concepts:

  • Debug Rendering: โ€œGame Engine Architectureโ€ Chapter 11 โ€” Jason Gregory
  • Dynamic Buffers: โ€œOpenGL Insightsโ€ Chapter 28 โ€” Cozzi & Riccio
  • Immediate vs Retained: โ€œDear ImGuiโ€ design philosophy โ€” Omar Cornut
  • Buffer Orphaning: โ€œOpenGL Superbibleโ€ Chapter 5 โ€” Wright et al.

Difficulty: Intermediate Time estimate: 1 week Prerequisites: Project 1, basic graphics pipeline

Real world outcome:

// In game update code:
debug.DrawLine(playerPos, enemyPos, RED);
debug.DrawSphere(bulletHitPoint, 0.5f, YELLOW);
debug.DrawBox(collisionAABB, GREEN);
debug.DrawText(playerPos + vec3(0,2,0), "Player 1");

// All draws batched and rendered efficiently at frame end
// Works from any thread, any system

Implementation Hints: Architecture:

  1. Thread-safe command queue collects draw requests
  2. End of frame: sort by type (lines, triangles, text)
  3. Build vertex buffer for each type
  4. Single draw call per type

Buffer streaming (OpenGL):

  • Use GL_DYNAMIC_DRAW or buffer orphaning
  • Map with GL_MAP_INVALIDATE_BUFFER_BIT | GL_MAP_WRITE_BIT

Shader: Simple vertex color, optional depth test toggle.

Learning milestones:

  1. Lines render โ†’ You understand dynamic geometry
  2. Batching reduces draw calls โ†’ You understand efficiency
  3. Thread-safe API works โ†’ You understand command buffering
  4. You use it for real debugging โ†’ Youโ€™ve built something useful

Project Comparison Table

Project Difficulty Time Depth of Understanding Fun Factor
1. Triangle Triptych Intermediate 1-2 weeks โญโญโญ โญโญ
2. Software Rasterizer Advanced 2-4 weeks โญโญโญโญโญ โญโญโญโญ
3. Shader Playground Intermediate 1-2 weeks โญโญโญ โญโญโญโญโญ
4. Multi-threaded Vulkan Expert 2-3 weeks โญโญโญโญโญ โญโญโญ
5. Memory Visualizer Advanced 2 weeks โญโญโญโญ โญโญโญ
6. Compute Mandelbrot Intermediate 1 week โญโญโญ โญโญโญโญโญ
7. Frame Profiler Advanced 2 weeks โญโญโญโญ โญโญโญ
8. PBR Model Viewer Advanced 3-4 weeks โญโญโญโญ โญโญโญโญ
9. Deferred Renderer Expert 3-4 weeks โญโญโญโญโญ โญโญโญโญ
10. GPU Particles Advanced 2-3 weeks โญโญโญโญ โญโญโญโญโญ
11. API Abstraction Layer Expert 1-2 months โญโญโญโญโญ โญโญโญ
12. Texture Streaming Advanced 3 weeks โญโญโญโญ โญโญโญ
13. RTX Ray Tracer Expert 1 month โญโญโญโญโญ โญโญโญโญโญ
14. Post-Processing Intermediate 2 weeks โญโญโญ โญโญโญโญ
15. Benchmark Suite Advanced 2-3 weeks โญโญโญโญโญ โญโญโญ
16. GPU Flame Graph Advanced 2 weeks โญโญโญโญ โญโญโญโญ
17. Debug Renderer Intermediate 1 week โญโญ โญโญโญ

If youโ€™re new to graphics programming:

  1. Project 2: Software Rasterizer โ€” Understand the GPU pipeline by building it yourself
  2. Project 1: Triangle Triptych โ€” See how APIs differ
  3. Project 3: Shader Playground โ€” Get comfortable with shaders
  4. Project 6: Compute Mandelbrot โ€” Understand GPU parallelism

If you know OpenGL but want to understand Vulkan:

  1. Project 1: Triangle Triptych โ€” Direct comparison
  2. Project 4: Multi-threaded Vulkan โ€” See Vulkanโ€™s killer feature
  3. Project 5: Memory Visualizer โ€” Understand explicit memory
  4. Project 15: Benchmark Suite โ€” Prove when Vulkan wins

If you want to build a game engine:

  1. Project 8: PBR Model Viewer โ€” Production-quality rendering
  2. Project 9: Deferred Renderer โ€” Scalable lighting
  3. Project 14: Post-Processing โ€” Visual polish
  4. Project 11: API Abstraction Layer โ€” Cross-platform support

If performance is your focus:

  1. Project 7: Frame Profiler โ€” Measure before optimizing
  2. Project 4: Multi-threaded Vulkan โ€” CPU-side optimization
  3. Project 15: Benchmark Suite โ€” Scientific comparison
  4. Project 12: Texture Streaming โ€” Memory optimization

Capstone Project: Mini Game Engine with Multi-API Support

  • File: GRAPHICS_API_MASTERY_OPENGL_VULKAN_DIRECTX.md
  • Main Programming Language: C++
  • Alternative Programming Languages: Rust
  • Coolness Level: Level 5: Pure Magic (Super Cool)
  • Business Potential: 4. The โ€œOpen Coreโ€ Infrastructure
  • Difficulty: Level 5: Master
  • Knowledge Area: Game Engines / Full Graphics Pipeline
  • Software or Tool: OpenGL + Vulkan + DX12
  • Main Book: โ€œGame Engine Architectureโ€ by Jason Gregory

What youโ€™ll build: A small but complete game engine renderer supporting multiple backends (OpenGL, Vulkan, DX12), featuring PBR materials, deferred lighting, post-processing, and a scene graphโ€”capable of rendering a playable game.

Why it teaches Graphics APIs: This is the ultimate integration project. Every previous project contributes a piece. Youโ€™ll understand why game engines are architected the way they are.

Core challenges youโ€™ll face:

  • All previous challenges combined โ†’ Maps to full system integration
  • Asset pipeline โ†’ Maps to offline processing and formats
  • Scene graph design โ†’ Maps to spatial data structures
  • Render queue sorting โ†’ Maps to state change minimization
  • Platform abstraction โ†’ Maps to cross-platform engineering

Key Concepts:

  • All previous resources, plus:
  • Engine Architecture: โ€œGame Engine Architectureโ€ โ€” Jason Gregory
  • Scene Graphs: โ€œReal-Time Renderingโ€ Chapter 19 โ€” Akenine-Mรถller et al.
  • Asset Pipelines: โ€œGame Engine Gems 1โ€ โ€” Eric Lengyel

Difficulty: Master Time estimate: 3-6 months Prerequisites: All previous projects (or equivalent experience)

Real world outcome:

$ ./my_engine --backend vulkan demo_game/

# Launches window with:
# - 3D scene with PBR materials, deferred lighting
# - Dynamic shadows, post-processing (bloom, SSAO, AA)
# - 200+ objects, 50+ lights @ 60 FPS
# - Player controller: WASD to move, mouse to look

$ ./my_engine --backend opengl demo_game/  # Same game, OpenGL backend
$ ./my_engine --backend dx12 demo_game/    # Same game, DX12 backend

# Engine console:
# > renderer.stats
# Draw calls: 89
# Triangles: 1.2M
# GPU time: 8.3ms
# Backend: Vulkan 1.3

Implementation Hints: Architecture layers:

  1. Platform layer: Window, input, filesystem (OS abstraction)
  2. RHI (Render Hardware Interface): Your API abstraction from Project 11
  3. Renderer: Deferred pipeline, shadow mapping, post-processing
  4. Scene: Scene graph, frustum culling, render queue generation
  5. Game: Assets, scripting, gameplay

Build incrementally:

  • Week 1-4: RHI with one backend
  • Week 5-8: Forward renderer, PBR materials
  • Week 9-12: Deferred conversion, post-processing
  • Week 13-16: Second backend, optimization
  • Week 17-24: Polish, third backend, demo game

Learning milestones:

  1. Triangle on one API โ†’ RHI foundation works
  2. Same triangle on two APIs โ†’ Abstraction is valid
  3. PBR materials look correct โ†’ Renderer works
  4. 60 FPS with complex scene โ†’ Performance is acceptable
  5. Playable demo game โ†’ Youโ€™ve built a game engine

Summary

# Project Name Main Language
1 The Triangle Triptych C++
2 Software Rasterizer C
3 Shader Playground C++
4 Vulkan Multi-threaded Command Recorder C++
5 GPU Memory Allocator Visualizer C++
6 Compute Shader Mandelbrot C++
7 Frame Timing Profiler C++
8 3D Model Viewer with PBR C++
9 Deferred Renderer C++
10 Particle System (GPU) C++
11 Cross-API Abstraction Layer C++
12 Texture Streaming System C++
13 Real-Time Ray Tracer (RTX) C++
14 Post-Processing Pipeline C++
15 Vulkan vs OpenGL Benchmark Suite C++
16 GPU Profiler with Flame Graph C++
17 Immediate Mode Debug Renderer C++
Capstone Mini Game Engine C++

Sources

Web Resources Consulted:

Books Referenced:

  • โ€œVulkan Programming Guideโ€ by Graham Sellers
  • โ€œVulkan Cookbookโ€ by Pawel Lapinski
  • โ€œOpenGL Superbibleโ€ by Wright et al.
  • โ€œOpenGL Programming Guideโ€ by Shreiner et al.
  • โ€œReal-Time Renderingโ€ by Akenine-Mรถller et al.
  • โ€œComputer Graphics from Scratchโ€ by Gabriel Gambetta
  • โ€œGame Engine Architectureโ€ by Jason Gregory
  • โ€œRay Tracing Gemsโ€ by Akenine-Mรถller et al.
  • โ€œGPU Gemsโ€ series by NVIDIA