Engine Design

C++, HLSL, DirectX
Building a game engine from scratch
January - May 2025

Key Skills Learned:

  • Advanced graphics debugging though Visual Studio
  • Writing complex HLSL shaders
  • Profiling multithreaded jobs to analyze & improve performance
  • Designing rigorous unit tests
  • Applying high-level vector math

Basic Inverse Kinematics
- Implemented one iteration of FABRIK (unconstrained)
- Added a debug line to verify the position calculations before adding rotations
- Utilized debug axes to visualize joint positions/rotations

Post Processing (Bloom)
- Created an off screen render target to save the scene as a texture
- Made a bloom shader to isolate the bright parts of the image
- Added down-sampled targets, half and quarter, to apply a two-pass gaussian blur with linear sampling
- Implemented two different blend states (opaque and additive) to add the bloom filter onto the original rendering

Normal Maps
- Added a new texture slot for the normal map in the graphics class and added that texture to the HLSL constants
- Created a new input layout to be able to take in the tangent variable
- Implemented the normal map shader
- Created a simple rotation component that can be added to any object to verify the normal map works properly

Jobs
- Added a profiler and timer to track how long different functions take to run
- Wrote this data to both a txt and json file to save the timing of the various functions being tracked
- Implemented a job manager and multithreaded workers to handle various jobs
- Learned to use Chrome Tracing to visualize that data ↓

Collision
- Implemented a Physics class, with AABBs and LineSegments
- Designed a unit test system for the AABB-AABB and AABB-LineSegment intersection
- Added a collision component to the player character so that it can stand on platforms and fall if not on the ground

Toon Shading
- Implemented a toon shader in HLSL with a four color threshold, based on a single colored directional light

Lambert / Rim / Half Lambert Shaders
- Implemented a Lambert shader, only the diffuse part of phong lighting (Left)
- Modified the Lambert shader to follow Half-Life's shading model, Half-Lambert - let the light wrap around the object, only hit black at 180° (Right)
- Added a rim shader to the Half-Lambert (Center)

Animation
- Implemented Skeleton and BoneTransform classes to handle information about bones/relations their parent through transform matrices
- Created an Animation class to dictate how those bones will move over the course of an animation
- Added a skinned shader to handle the the matrix vector and all the bones of the model

Models
- Created an asset manager to cache various important assets for reuse.
- Implemented json level loading for scene objects
- Added components to scene objects to allow for different behavior, demonstrated with a point light component

Lighting
- Added a Material class to keep track of different properties of objects such as specular power, etc.
- Implemented the lighting system to keep track of point lights in the scene
- Created a phong shader to consider point light colors, material constants, and color/texture of the cube

Texture
- Implemented a z-buffer so that shapes could be drawn with depth and inside one another
- Loaded a texture and created a new mesh to handle its uv coordinates
- Added that texture information to the cube shader

Cube
- Added a matrix to move objects around, and a Camera class to fix warping
- Implemented the vertex and index arrays for the cube, taking into account proper draw order

Triangle
- Created a vertex buffer to take in the vertices of the triangle
- Implemented a simple shader to render the triangle on screen
- Created helper classes (VertexBuffer, RenderObj) to encapsulate rendering of simple objects