# Day 5 of building TitanEngine from scratch using modern C++20 and native DirectX 12—following a strict zero-helper philosophy (no d3dx12.h, no high-level wrappers).

**URL:** <https://forums.unrealengine.com/t/day-5-of-building-titanengine-from-scratch-using-modern-c-20-and-native-directx-12-following-a-strict-zero-helper-philosophy-no-d3dx12-h-no-high-level-wrappers/2856720>\
**Category:** C++\
**Tags:** unreal-engine, CPP\
**Created:** [November 16, 2026, 3:49pm UTC](https://forums.unrealengine.com/t/day-5-of-building-titanengine-from-scratch-using-modern-c-20-and-native-directx-12-following-a-strict-zero-helper-philosophy-no-d3dx12-h-no-high-level-wrappers/2856720 "2026-11-16T15:49:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevinpc\_1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kevinpc_1/32/1215238_2.png) [@kevinpc\_1](https://forums.unrealengine.com/u/kevinpc_1)\
**Post date:** [November 16, 2026, 3:49pm UTC](https://forums.unrealengine.com/t/day-5-of-building-titanengine-from-scratch-using-modern-c-20-and-native-directx-12-following-a-strict-zero-helper-philosophy-no-d3dx12-h-no-high-level-wrappers/2856720/1 "2026-11-16T15:49:14Z")

</div>

**Day 5 of building TitanEngine from scratch using modern C++20 and native DirectX 12—following a strict zero-helper philosophy (no `d3dx12.h`, no high-level wrappers).**

In this devlog, we transition from clearing the back buffer to rendering real geometry on screen by building the programmable graphics pipeline from the ground up.

### ⏱ Timestamps / Chapters:

- **0:00** - Introduction & Day 5 Goals

- **1:00** - Step 1: Writing Pure HLSL Vertex & Pixel Shaders (`shaders.hlsl`)

- **2:30** - Step 2: Runtime Shader Compilation (`d3dcompiler`) & Empty Root Signature

- **4:30** - Step 3: Input Layout, Pipeline State Object (PSO) & VRAM Vertex Buffer (`UPLOAD` Heap)

- **7:00** - Step 4: Recording the Draw Call (`DrawInstanced`) & Final Render Result

### 🛠 What We Built Today:

- **HLSL Shaders (`shaders.hlsl`):** Pure Vertex (`VSMain`) and Pixel (`PSMain`) shaders handling 3D vertex positions and smooth color interpolation.

- **Runtime Compilation:** Using `D3DCompileFromFile` directly in C++20 with `ID3DBlob` error diagnostics.

- **Root Signature & Input Layout:** Creating an explicit Root Signature with Input Assembler access and mapping `POSITION` (`float3`) and `COLOR` (`float4`) vertex attributes.

- **Pipeline State Object (PSO):** Packing compiled shaders, rasterizer states, blend states, and `R8G8B8A8_UNORM` render target formats into an `ID3D12PipelineState`.

- **VRAM Memory Management:** Allocating an `UPLOAD` heap resource (`ID3D12Resource`), mapping CPU-to-GPU pointers, and configuring `D3D12_VERTEX_BUFFER_VIEW`.

- **First Draw Call:** Binding the pipeline state, viewports, and scissor rects to issue `DrawInstanced(3, 1, 0, 0)` and render our first tricolor triangle.

### 💻 Tech Stack:

- **Language:** C++20

- **Graphics API:** Native DirectX 12 / DXGI 1.6 (Zero Helpers)

- **Shading Language:** HLSL (Shader Model 5.0)

- **Platform:** Windows x64 (Native Win32 API)

```auto
 -link of video day 5:https://youtu.be/83V_iCkINCI

```

#DirectX12 #Cpp20 #GameEngineDev #GraphicsProgramming #LowLevelCode #hlsl #GameDev #TitanEngine #RenderingEngine #EngineProgramming
