Graphics Sample Gallery
DirectX 12 Basic Rendering
A fundamental sample demonstrating the core concepts of DirectX 12, including pipeline creation, command buffers, and resource binding for basic 3D rendering.
View SampleDirect2D Transforms
Explore the power of Direct2D transformations like translation, rotation, and scaling. This sample shows how to manipulate 2D shapes and text efficiently.
View SampleDirectWrite Text Layout
Learn how to use DirectWrite for advanced text rendering, including complex script shaping, line breaking, and bidirectional text support.
View SampleShader Model 6.7 Compute Shader
Implement parallel processing on the GPU using compute shaders. This sample demonstrates a simple image processing effect accelerated by a compute pipeline.
View SampleXAML Graphics Integration
See how to integrate DirectX graphics rendering seamlessly within a XAML application using `SwapChainPanel` and modern Windows UI development practices.
View SampleWPF Hardware Acceleration
Understand how Windows Presentation Foundation (WPF) utilizes hardware acceleration for rendering. This sample showcases custom drawing with hardware acceleration.
View SampleFeatured Sample: DirectX 12 Basic Rendering
This sample serves as an excellent starting point for developers new to DirectX 12. It meticulously walks through the essential steps required to initialize the API, set up the device and swap chain, compile shaders, create input layouts, and render a simple triangle to the screen.
Key features:
- Device and Adapter Selection
- Command Queue and Command List Management
- Shader Compilation (Vertex and Pixel Shaders)
- Root Signature and Pipeline State Object (PSO)
- Resource Binding and Descriptors
- Swap Chain and Presenting Frames
Code Snippet Example (HLSL Pixel Shader):
// Basic HLSL Pixel Shader for DirectX 12
float4 main(float4 pos : SV_POSITION) : SV_TARGET
{
return float4(1.0f, 0.5f, 0.0f, 1.0f); // Output an orange color
}
Explore DirectX 12 Basic Rendering