What is it?
This project is a graphics engine made using DirectX 11.
For this project, I had to make a graphics engine in Direct X 11.
To do this, I needed to implement features such as texture and model loading, per-pixel lighting and skyboxes.
In addition, I decided that I would add full scene loading and external lua scripting so that it could be used as a basic game engine.
Who did what?
Libraries used
Sol2Lua
JSON for Modern C++
DDSTextureLoader
OBJ loader: provided by uni
Tools used
TexassembleModels used
Cauldron and brothFish
Witch hat
Textures used
Box texturesGlass texture
Ground texture
Rock texture
Skybox images
Tree texture
Wood texture
ChainLink(2): provided by uni
Crate textures: provided by uni
Everything else in the project was done by myself
When was it worked on?
Work started on the project around September 2020 and finished around Christmas 2020
What are the controls?
WASD to move and the mouse to look. 1-5 to swap to the debug camera, static camera, top down camera, third person camera and first person camera respectively
What went right/wrong during development?
One of the things that went right in this project was the heavy use of a component system.
When I was working on my OpenGL project, I didn't use a component system as I wasn't aware of the design pattern at the time.
However, I quickly ran into the problems that just using inheritance brings. So, for this project, I decided early on that I would use a component system.
I found that this made it far easier to add new functionality, and that it made the code much cleaner.
Another one of the things that went right in this project was the scripting support.
For this project, I wanted to allow for external scripting so that changes could be made to some parts of code without having to recompile.
To do this, I used Lua and Sol2.
Using Sol2, I was able to create the CustomComponent class, which initialises the lua script and passes data between lua and C++.
As a result of this, most of the cameras in the program were able to be written using lua.
One of the things that went both right and wrong in this project was the level loading.
One of the features that we had to provide for this was positioning assets via a configuration file.
I decided to expand on this and have the entire scene be specified in a file.
While I did get this all working, the code ended up being quite messy,
as each component need a separate LoadedComponent class which would load the necessary data.
A new component was then created, using the LoadedComponents data as parameters.
This ended up not being much of a problem, as any new components could be created using lua
via the CustomComponent. However, if I was to try and add new component types it would be a problem as each new component would need multiple classes to work.
Where can I access the source code?
The source code can be found on my github account. Alternatively, you can click here to go straight to the github page.