// C++ Projects

3D Graphics with C++ and DirectX 11 

As part of the Graphics Programming course at DePaul University, I learned how to work with DirectX 11 to render 3D graphics using C++. The final project is composed of the following features: 

Shaders: There are four main 3D shaders included in the final build. One that simply handles coloring pixels, A shader that adds ambient, diffuse, and specular parameters to create a simple material, light A texture shader that handles UV mapping, and a final, cumulative shader that handles textures, as well as a basic material. 

Graphic Objects: Each shader has a corresponding object that handles user parameters and rendering of a provided model, with proper object-oriented techniques. 

Primitives: The final build includes a set of functions to generate basic primitive 3D objects. Each function generates vertices, and links them up with properly wound triangles. These primitives include a unit box with textured faces, a unit box with inverted normals (skybox), a unit pyramid, and a unit sphere. 

Terrain: The terrain is generated much the same way as the other primitives, but is built to take in a heightmap as a parameter and generate an appropriately sized plane with repeating textures and variable vertex heights. 


Mirrors: Additionally, I've learned how to manipulate the stencil buffer to create a mirror using DirectX 11, which is demonstrated in the gallery below. 


C++ Game Engine

I've been developing a 3D game engine using C++ for about 5 months as part of the Game Programming Major at DePaul University. The Game Engine courses focus on implementing object-oriented design patterns to develop a robust piece of software capable of handling fundamental 3D Engine functionality. Here are some of the design patterns implemented in my engine, coupled with the features they are used for:

Command Pattern: Used to register game objects to a "scene" to execute specialized functions. The pattern is especially helpful in optimizing away checks that would otherwise occur each frame, such as collision, alarm, and input events. 

Object Pool / Factory Pattern: This pattern is mainly used by Singleton factories that manage game objects that have some kind of life cycle, and can be recalled. For example, the Tank object uses a bullet factory to instantiate bullet objects, register them to a scene, de-register them, and finally return them to an object pool to be used again.

Visitor Pattern: I've implemented 3D tiered collision between Bounding Spheres, Axis Aligned Bounding Boxes, and Oriented Bounding Boxes in my engine. The visitor pattern has allowed me to handle collision calculations between these three types, with an optimized method agnostic of the actual collision volume type. I can essentially plug in an arbitrary collision volume type, and the compiler will choose the correct two collision volumes in the event of a collision, and execute the desired collision calculation.   

Observer PatternUsed liberally at many points in my implementation, usually to communicate between a "spawned" object and the class that spawned it. 


© 2019 by Greg Weeks