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).

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.

:stopwatch: 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

:hammer_and_wrench: 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.

:laptop: 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)

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

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