KDGpu Examples¶
These examples are organized by complexity, from basic triangle rendering to advanced techniques like ray tracing and order-independent transparency. Most examples use the KDGpuExample Helper API to reduce boilerplate and focus on the specific technique being demonstrated.
Examples assume you understand basic 3D graphics concepts (vertices, shaders, coordinate systems, matrix math, texture sampling, depth testing) but not necessarily Vulkan-specific APIs.
Beginner Examples¶
These examples introduce fundamental rendering concepts and the KDGpu API. Start here if you're new to KDGpu or Vulkan.
- Hello Triangle - Your first triangle using the KDGpuExample helper API
- Hello Triangle Native API - Raw KDGpu API showing all initialization steps without helper abstractions
- Hello Triangle HLSL - Using HLSL shaders instead of GLSL with DXC compilation
- Hello Triangle Slang - Using Slang shaders instead of GLSL with Slang compilation
- Textured Quad - Texture loading, sampling, and applying textures to geometry
- Hello Triangle with Frame Overlap - Triple-buffered rendering with fence synchronization for frame overlap
- Hello Triangle (Native Apple) - Platform-specific initialization for macOS using MoltenVK
Intermediate Examples¶
These examples demonstrate multi-pass rendering, anti-aliasing, compute shaders, and descriptor management.
Multi-Sample Anti-Aliasing (MSAA)¶
- Hello Triangle MSAA - Multi-sample anti-aliasing for smooth edges
- Hello Triangle MSAA with Dynamic Rendering - MSAA with VK_KHR_dynamic_rendering extension
Multi-Pass Rendering¶
- Render to Texture - Off-screen rendering to texture for multi-pass effects
- Render to Texture with Subpasses - Efficient subpass-based rendering for tile-based GPUs
- Render to Texture (Dynamic Rendering with Local Read) - Subpasses with dynamic rendering
- Depth Texture Sampling - Sampling depth textures in shaders for advanced effects
- Depth Bias for Shadow Mapping - Depth bias for shadow mapping and z-fighting prevention
Uniform Buffers and Compute¶
- Dynamic Uniform Buffer - Dynamic uniform buffer offsets for efficient per-object data
- Compute Particles - GPU particle simulation using compute shaders
- Offscreen Rendering to Image File - Headless rendering to image files without a window
Descriptor Management¶
- Descriptor Indexing with Bindless Rendering - Descriptor array indexing with nonUniformEXT qualifier
- Partially Bound Descriptors - Partially bound descriptor sets for flexible resource binding
- Host Image Copy for Texture Upload - Host-side image copying with VK_EXT_host_image_copy
Multi-View Rendering¶
- Multiview Rendering - Multi-view rendering for VR and stereo rendering
- Multiview Stereo Swapchain - Stereo swapchains for VR headsets and 3D displays
Advanced Examples¶
These examples showcase modern rendering techniques including mesh shaders, ray tracing, order-independent transparency, and XR.
Modern Pipeline Features¶
- Hello Sphere Mesh Shader - Mesh shaders for GPU-driven geometry generation
- Buffer Device Address (GPU Pointers) - GPU pointers with VK_KHR_buffer_device_address
Ray Tracing¶
- Hello Triangle Ray Tracing - Introduction to ray tracing with acceleration structures
- Hello Sphere Ray Tracing - Procedural geometry with ray tracing intersection shaders
- Hybrid Rasterization and Ray Tracing - Hybrid rasterization and ray tracing pipeline
Advanced Rendering Techniques¶
- Order Independent Transparency (OIT) with Compute - Order-independent transparency using per-pixel linked lists
- Wireframe Geometry Shader - Single-pass wireframe rendering with barycentric coordinates
XR (Extended Reality)¶
- Hello XR (OpenXR VR Application) - OpenXR integration with compositor layers and passthrough
- Hello XR Multiview - XR rendering with multi-view for efficient stereo rendering
About the Helper API¶
See KDGpuExample Helper API for details about the KDGpuExample helper API used by most examples, and when to use the native API instead.
Updated on 2026-03-31 at 00:02:07 +0000