top of page

EFFECT ENCAPSULATION

Controls: Esc - To quit game
Arrow Keys to give move direction to the sphere
WASD to change the rotation-axis of 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
 
The bob effect moves up and down on the y-axis by modifying the local position’s y by certain offset in the vertex shader and it also modifies the green channel in the fragment shader.  
 
I have marked the length of each path in red for clarity in the screenshot.
During runtime, the second path in the file is determined from the length of the first string along with the null terminated character stored before the first path in the file. This makes the bumping of the pointer easier. 
Also, I store paths relative to game directory instead of built asset directory. I chose to increase the file size by storing the count and the “data/” prefix as I personally feel it is worth increasing the size of the file by 6 bytes to get faster runtime. I do not need to calculate where to bump my data pointer on the fly to point to next path nor do I need to do a string concatenation to add the prefix to relative path. The downside of this is bigger binary file.
 
In images below the apple and the name game objects have the bob effect. The name also rotates on its own with the help of a controller.
For the final I am going to use this effect on apple that will spawn at random places as snake’s food.
Below is my platform independent render frame function for graphics. 
The objective of this assignment was to create and load binary effects file. Also to create another effect and use it for our final game if possible.
Apart from this I created the binary game object file. So now my assetstobuild.lua only contains one thing a table of gameobjects. All the assets are built through that table using the registered referenced asset function in lua. I have incorporated hashedstring class from last year’s Joe’s code to generate UUID for controller classes. I only faced some difficulty in overriding ConvertSourceRelativePathToBuiltRelativePath function in lua which JP and I solved together. I also sorted the draw call data according to effects so that calls to effect binding only happen when a new effect is required to be bound. 

bottom of page