📝This repository contains small, progressive DirectX Ray Tracing examples, designed to teach and demonstrate each part of the graphics pipeline in an intuitive and minimalistic way.
Each sample is isolated and focused, making it easy to learn DirectX Ray Tracing step by step, without unnecessary complexity.
| Example | Details |
|---|---|
![]() |
Pipeline This example shows how to use DirectX Raytracing (DXR) to write directly to a texture using a ray generation shader. No acceleration structures or geometry are used — this is the simplest possible DXR setup, useful to understand how DispatchRays works and how GPU threads map to pixels. (PSOs [ID3D12PipelineState]) |
![]() |
AccelerationStructures This example introduces acceleration structures (BLAS and TLAS) and shows how to trace rays against real geometry. A single triangle is built into a bottom-level acceleration structure and instanced in a top-level structure. Rays are dispatched and intersect the triangle using the ray tracing pipeline (ray generation, miss, and closest hit shaders). |
![]() |
VertexBuffer This example demonstrates how to provide vertex data to a DirectX Raytracing (DXR) pipeline using a StructuredBuffer accessed via a Shader Resource View (SRV). Vertex attributes, such as position, color, normals, or UVs, are read directly by ray generation and closest hit shaders. This approach enables vertex pulling. |
![]() |
IndexBuffer This example demonstrates how to provide index data to a DXR pipeline using a StructuredBuffer through a Shader Resource View (SRV). The index buffer defines the connectivity of vertices to form triangles and is accessed directly by ray tracing shaders. Combined with the vertex buffer, this enables ray tracing shaders to traverse and intersect geometry. |
- Help others learn how to use pure DirectX Ray Tracing.
- Serve as a personal reference for building engines or tools.
- Keep things clean, readable, and low-level.
- Windows 10/11
- Visual Studio 2019 or newer
- DirectX Ray Tracing compatible GPU



