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 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 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
- modified lambert to follow half-life's shading model, half-lambert (let the light wrap around the object, only hit black at 180°)
- finally, added a rim shader to the half-lambert

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
- added 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