Project Information
- Language: C++
- Graphics API: DirectX 11
- Creation: Y2 S1
- Source URL: GitHub Page
Graphics Framework
Created as part of my Further Games and Graphics Concepts module in semester 1 of my second year. The task was to create a framework using the DirectX graphics API, which would allow for the simple use and addition of numerous graphical elements, by utilizing abstraction to its fullest extent. The application was to also demonstrate an understanding of numerous 3D graphical concepts through physical implementations. Using the framework in question, the incorporation and modification of these features should be made as simple as possible to ensure the intuitive creation and modification of each of these components.
What Did I Learn?
As I had previously created an engine in DirectX 11, the main aim of this application was to utilize abstraction to allow for the simple creation and integration of graphical components. Subsequently, I learned quite a lot regarding abstraction and the many uses of C++ which allowed for this. Collision checking is one example of where C++ was a benefit in that by utilizing static functions, I was able to minimize this implementation to one line of code, meaning that this was all that was required to check for collisions between the scene objects, including the cameras.
// static functions to check for collisions static bool CheckCollision3D( GameObject3D& object1, GameObject3D& object2, float radius ); static bool CheckCollision3D( std::shared_ptr<Camera3D>& object1, Light& object2, float radius ); static bool CheckCollision3D( std::shared_ptr<Camera3D>& object1, GameObject3D& object2, float radius, float yOffset = 0.0f );Along with this, I also implemented an ImGuiManager class which allowed for the toggling and modification of features at runtime. For the purpose of testing feature implementations, the ImGuiManager allowed the simple creation of an ImGui window to test the functionality of these features with the optional modification of its parameters.
With the additional implementation of an entity-component system, this allowed for the simple addition of new objects within the scene, as they could inherit functionality from the appropriate class according to whether the object is 2D or 3D. Inherited functionality includes functions for moving, rotating and scaling objects and more. Specialized objects, such as cameras, could inherit from the ECS, but also utilize its own class with specialized functionality for viewing the scene.
// draw all models into the scene for ( unsigned int i = 0; i < renderables.size(); i++ ) renderables[i].Draw( cameras[cameraToUse]->GetViewMatrix(), cameras[cameraToUse]->GetProjectionMatrix() );Researching and implementing each of these framework components had me learn a lot more about DirectX and especially C++ when trying to ensure a minimal amount of code when creating and incorporating a graphical feature into the application.
Future Additions
After furthering my knowledge in DirectX and building upon my C++ skills, I plan to enhance and refine the current features such as the lighting system, to allow several light sources at once along with dynamic shadow mapping to boost the realism of the scene. I also plan to work on the shaders for the lighting system, and perhaps incorporate a water implementation which would utilize the lighting within the scene.
I also plan to incorporate a physics engine, which is also the task of semester 2 for this module, which would allow for objects to interact with each other following collisions. This will also require more work on the ECS to allow for more specialized objects to be created and easily placed within the scene. With this addition of an A.I. system, this could allow for character objects to be added which could follow or target the player.
Further from this, I would also like to implement a PBR system, which would overhaul the current lighting and texturing system, but seeing as this would require extensive time and effort, this is something that I will likely implement once I have fully refined the framework.