So far I have been building all my assets through a lua file which contained specific code for each asset that would be built. This meant that every time I had to build a new asset, I had to copy and paste a bunch of code and change the asset and builder names. As you might have guessed, this is error prone, cumbersome and not scalable.
In this assignment I aim to fix this by making changes to the build system. I now have two lua files: one which contains generic code to build all the different types of assets and the second lua file would just be a list of the assets that need to be built.
The “AssetsToBuild” lua file is passed to the “AssetBuildExe.exe” which in turn will pass the file names to the “AssetBuildFunctions” lua file which will call the appropriate builders to build the asset files.
Let us walk through this file:
The built shader and texture files have a different extension to the unbuilt ones. To enable this I had to override one of the functions in the “AssetBuildFunctions” lua file.
There is one thing that the new build system cannot do and that is selectively build assets for D3D and OpenGL. This means that I need to make sure that the Vertex Input Layout shaders get built for OpenGL even though I don’t use it.
Once everything built, the game looks the same as before so we know everything is working.
You can move the camera using the following controls: