The Assignment:
This time I added human-readable effect files. An effect builder project was added to convert human-readable effect files to binary at build time. The building process also took care about registering the shaders being used in an effect. So, from now on, there is no need to explicitly specify which shader to be build. The process of building effects will handle that part behind the scenes.
The Results:
A Windows application that renders several simple meshes in a window where both the camera and the mesh object are movable.
Control of the game: Hold W/A/S/D to move the camera up/left/down/right. Hold Q/E to move the camera forward/backward. Hold arrow keys to move the cube up/left/down/right.
Human-readable Effect File:
Binary Effect File:
The binary data is simply a concatenation of two path strings (with a null terminator separating the two). So, at run-time, the code searches for the null terminator in-between the two file paths to do the split.
The paths stored are relative to $(GameInstallDir) instead of $(GameInstallDir)/data. One advantage of doing it this way is that we don’t need to worry about adding prefix to the passed in path strings so that it saves a little bit of time at run-time when initializing an effect. But on the other hand, prefixing the path strings means slightly increase in size for the binary files. I can’t really tell which way is better for our purposes, so I choose the easier solution for me in this case.
Extracting the Two Paths: