top of page

INTRODUCING BUILDERS

Controls: Esc - To quit game

WASD to move the cube

Move the camera

OU(Z-axis)

IK(Y-axis)

JL(X-axis)

Rotate the camera

YR(Z-axis)

TG(Y-axis)

FH(X-axis)

C/V to traverse cameras in the camera vector

 

In this assignment, there is no visual change to the scene. We have changed the way the assets get built in the asset pipeline. The objective of the assignment was to build assets using lua.

For authored Direct3D and OpenGL shaders I use the extension .txtshdader as these are text files. For built shaders, in Direct3D I use the extension .binshader cause they have been compiled to binary files and for OpenGL I keep the extension same (.txtshader) as they are compiled during run time.

Yes, I added AssetsToBuild.lua in solution explorer in the build all assets project because this is the project which executes the AssetBuildSystem.exe to build the assets. Also since AssetsToBuild.lua contains the list of all the assets to build this location made the most sense for me.

The BuildAllAssets project depends on shader builder and mesh builder. It has the AssetBuildSystem.lua which needs both the shaderbuilder.exe and meshbuilder.exe to execute its code.

AssetsToBuild.lua reduces the number of arguments we pass to AssestBuildSystem.exe to one. Earlier we had to pass the relative path of every asset as a command line argument to the AssestBuildSystem.exe but now all those relative paths are stored in a single place i.e. AssetsToBuild.lua. This makes adding more assets a trivial task.

In Direct3D, the built vertex shader in debug build is 18,062 bytes whereas in release build its 1,380 bytes. So, it is 16,682 bytes smaller in the release build. This difference is caused due to disabling the optimizations and enabling debugging in a debug build while doing the opposite (i.e. not disabling the optimizations and not enabling debugging) in a release build. This is desirable as we want the release build shader to be as fast as possible when it executes the code during runtime whereas in a debug build we need all the extra help that we could get from the debugging information stored in the debug shader to track any bugs that may occurs during execution.

In OpenGL, the built vertex shader in debug build is 2,683 bytes whereas in release build its 812 bytes. So, it is 1871 bytes smaller in the release build. Although the code in both these files is the same the comments and unnecessary new line feeds have been pruned away to reduce the size of the release build shader from that of the debug build shader in OpenGL.

For this assignment, the major problem I faced was caused because of my AntiVirus. My shaderbuilder.exe for debug x86 was getting executed in the sandbox of my antivirus which in turn caused my visual studio to hang up and I lost all access to its executables. To regain access I required to constantly reboot my system. This was frustrating. Some of the other minor problems I had was how to access c++ #defines in lua and how to call base class function in lua. For the first I wrote a helper function in c++ which helped me to set the correct value of a string in lua to recognize which platform I was executing. For the second one JP helped me by giving the right syntax to call the base class functions in lua. The assignment was quite easy to do and didn’t take much of my time. Loading the binary shaders for Direct3D was easy too. I wish JP could have just given us the list of functions in the platform project and told us to load shaders on our own instead of giving us the code upfront.

bottom of page