Você está na página 1de 3

Assignment 8

This assignment deals with processing platform independent shaders. Also these shaders are built as
binary shaders before being used by the game. This improves performance for the game.
1. Game ControlsThe arrow keys are used to move the sphere.
W,A,S,D is used to move the camera.
Q,E is used to zoom the camera in and out.
2. Below is the screenshot of the game built with the unified shader-

3. I use the same file extension for the authored shaders and built shaders. This is convenient
because logically both are the same shader file. One is compiled and built while the other
version is in the human-readable format. Both perform the same functionality but are
represented differently hence I kept the same file name.
4. I added AssetsToBuild.Lua in the $(AuthoredAssets) directory. This is because AssetsToBuild.Lua
represents the list of all the assets we wish to build for the game. Hence it can be thought of as
a group of assets instead of a single asset. Also, it is easier to update this file quickly in case any
new asset has to be added to $(AuthoredAssets)meshes or $(AuthoredAssets)shaders folders.
5. The project AssetBuildSystem depends on ShaderBuilder and MeshBuilder and
subsequently, BuildAllAssets depends on AssetBuildSystem. This is necessary because
MeshBuilder.exe and ShaderBuilder.exe are two executable files which are run by the
AssetBuildSystem. Hence we have to ensure that those two get built first. To convert an
authored asset into a built asset we must have these 2 exes.

6. AssetsToBuild.Lua has the following advantagesa. We can segregate all the assets into one file.
b. We dont have to add each asset individually in the custom build step of the
BuildAllAssets project, which makes adding/changing assets much easier.
c. Its a Lua script so a non developer can also edit and make changes to the script easily.

7. In Direct3D, the size difference between the vertex.shader of the debug and release builds is
16KB. This size difference is because the vertex.shader which is built on the debug configuration
has human readable part as well. This helps the developer to debug the data much more easily
then by just going through the vertex.shader of the release build which is basically binary code.
Now its ok that the file size for the debug build is bigger than that of the release build. While we
are debugging the size or performance of the game is not of utmost importance. However in the
release build we need minimum size for the assets so that we have faster load times. Also by
keeping the assets in binary format, they can be loaded in memory much faster.

8. In OpenGL, the size difference between the vertex.shader of the debug and release builds is
2KB. Here both the shader files are not built. However in the vertex.shader of the debug build,
we have included all comments as well. Again these comments are useful for the developer
when debugging however they are of no use in the release build and can be removed safely for
a smaller file size.

9. Places where I faced difficulty in this assignmenta. I faced the issue of the BuildAllAssets project taking 4 arguments instead of one. This was
because the path was not passed as a string.
b. I faced some issue with trying to copy the authored mesh to the built mesh directory. This
was because I was initially trying to execute the copy command of windows in code.
However I finally ended up using the eae6320::Platform::CopyFileA function as the copy
command was not working after trying all combinations of it.

Você também pode gostar