https://youtube.com/playlist?list=PLXrxdHvhMCuDurn_0heADnFvAuU0MJ2qA&si=DglcRUGw4UCXyhUU
A feature-rich 3D rendering engine built from the ground up in C++ and DirectX 11. This project represents a comprehensive, structured study of the architecture, systems, and advanced rendering techniques that power modern real-time graphics.
The goal of this endeavor was to gain a deep, practical understanding of every component in a modern graphics engine. I systematically built each system from scratch, starting with an empty Win32 window and progressing to advanced techniques like Physically Based Rendering (PBR), Shadow Mapping, and Deferred Shading.
This engine is not just a collection of features; it's a testament to a disciplined approach to learning and implementing the complex interplay between low-level APIs, shader programming, and engine architecture.
The engine is built on a modular framework that handles all the foundational systems required for real-time rendering.
- Core Systems: Robust framework for Win32 window management, Direct3D device initialization, and input handling (DirectInput & XInput).
- Rendering Pipeline: A complete pipeline for managing buffers, shaders (HLSL), textures, and 3D models. Includes a shader management system for handling multiple complex shaders.
- 2D & UI: A flexible 2D rendering system for sprites, timers, and a custom font engine for UI elements like FPS counters.
- Audio Engine: A 3D audio system built on DirectSound and XAudio2 for positional sound effects.
Throughout the engine's development, I implemented a wide array of classic and modern rendering techniques. The highlights include:
| Lighting & Materials | Shadows & Post-Processing | Advanced & Effects |
|---|---|---|
| Physically Based Rendering (PBR) | Shadow Mapping (Directional & Soft) | Hardware Tessellation |
| Diffuse & Specular Lighting | Screen Space Ambient Occlusion (SSAO) | Deferred Shading |
| Normal & Specular Mapping | Render to Texture | Instancing |
| Multiple Point Lights | Fog, Blur, and Glow Effects | Particle Systems (Animated) |
| Light Maps & Alpha Mapping | Transparency & Reflection | Billboarding & Frustum Culling |
This project was the single most valuable learning experience of my software engineering journey.
-
The Graphics Pipeline in Practice: I moved from a theoretical understanding of the graphics pipeline to a deep, practical mastery. I now intimately understand how data flows from the CPU to the GPU, through vertex and pixel shaders, and finally to the screen.
-
Engine Architecture & Design: I learned how to structure a large, complex application. This involved designing modular systems for graphics, input, audio, and UI that could interact with each other without being tightly coupled.
-
Shader Programming (HLSL): I wrote dozens of shaders, gaining proficiency in HLSL for implementing everything from simple texturing to complex PBR lighting models and post-processing effects.
-
The Bridge Between Theory and Reality: Implementing each technique taught me the "why" behind the algorithms. I didn't just learn what shadow mapping is; I learned the challenges of shadow acne and the trade-offs between different shadow map filtering techniques. This is the practical, hard-won knowledge that only comes from building.
- Languages: C++, HLSL
- APIs: DirectX 11, Win32 API, DirectInput, XInput, DirectSound, XAudio2
- Tools: Visual Studio 2022, Git
- Requirements: Windows, Visual Studio 2022
- Steps:
- Clone the repository:
git clone https://github.com/tuananohut/CustomEngine.git - Open the
CustomEngine.slnfile in Visual Studio. - Set the solution configuration to Release and platform to x64.
- Build and run the project (F5).
- Clone the repository:
The structured, step-by-step development of this engine was made possible by the comprehensive and excellent tutorial series provided by RasterTek.
All 3D models, textures, and sound assets used for demonstration purposes are credited within their respective project files and sourced from creative commons or free-to-use platforms like Itch.io and Pixabay.
https://screamingbrainstudios.itch.io/tiny-texture-pack-2
https://screamingbrainstudios.itch.io/planet-texture-pack-1
https://pixelfranek.itch.io/free-textures-of-light
https://digitalmoons.itch.io/parallax-forest-background
https://pixabay.com/sound-effects/pianos-by-jtwayne-7-174717/
https://pixabay.com/sound-effects/violin-phrase-marina-short-99956/
https://pixabay.com/sound-effects/woodland-footsteps-mono-69553/
https://pixabay.com/sound-effects/fire-sound-222359/
https://pixabay.com/sound-effects/pad-space-travel-hyperdrive-engine-humming-235901/