Shantanu Pandey
  • Projects
    • Hard Light Vector
    • Memory Manager
    • Samurai Crusader
    • Dyslexia VR
    • Geriatric Depression Suite
  • Prototypes
    • Game Mechanics
    • Diana's Inferno
    • MakeUp & BreakUp
    • 10Pest
    • Ninja Pinball
  • Blogs
    • Sic Parvis Magna
    • Game Engineering - Week 1
    • Game Engineering - Week 2
    • Game Engineering - Week 3
    • Game Engineering - Week 4
    • Game Engineering - Week 5
    • Game Engineering - Week 6
    • Game Engineering - Week 7
    • Game Engineering - Week 8
    • Game Engineering - Week 9
    • Engine Feature - Audio Subsystem
    • Final Project - GameEngineering III
    • AI Movement Algorithms
    • Pathfinding Algortihms
    • Decision Makiing
  • About

Week 9 - 10/24/2018

11/1/2018

0 Comments

 
After converting our mesh file to binary in last week’s assignment, this week required us to do the same for the effects. We created human readable effect files, build them as binary and use that binary file to load the effects.
Effect Builder
As we created the mesh builder earlier, for this assignment we created an effect builder. The job of effect builder was to read the human readable effect file and save them as binary in the game install directory. Like mesh builder, this is also run at the build time of the program.
Like mesh builder and effect builder, we have another app called as ShaderBuilder which builds the actual shader used by the effects. Previously, we used to specify the shaders to build in out AssetsToBuild.lua file (this file stores all the information of the assets for the AssetBuilder to build). Now since the path of these shaders is in our human readable file, we don’t need to specify them in the AssetsToBuild, rather they registered for building before we make a call to execute Effect Builder.
​
Binary Files
For showing an effect on screen, we need the following information:
  • Path of vertex shader used.
  • Path of fragment shader used.
  • Render state bits: Render state defines the fixed function that can be configured on the GPU. This isn’t programmable buts instead has a pre-defined set of behaviors that can be configured. This can be used to enable alpha transparency, depth buffering or culling in our program.
Picture
Human Readable file
Picture
Binary File
This first byte of binary file is used to store render state bits. Next two bytes are used store the lengths of the file paths for vertex and fragment shader. The following bytes are used to store the actual file paths for the shaders. I am storing vertex shader first and fragment shader second.
Below are some of the thing I kept in mind while writing this file:
  • Vertex shader and fragment shader paths are separate by a NULL (“\0”) character. This is because while reading the binary data, C++ terminates the string as soon as it encounters the null character. This is useful as now we just need the start location of the path to extract it from binary data.
  • I have stored the length of first shader path (vertex in my case) so that it is easy to judge the start location of the second path. We actually don’t need the length of second path. I am storing it just to have complete information (maybe we can extend the system so that it is useful). It adds one additional byte which we can avoid as this point.
  • I am also prefixing “data/” before the start of vertex and fragment shader paths. This is because Asset Build System paths are relative to (GameInstallDirectory)/data and at the run time current working directory is (GameInstallDirectory). Prefixing “/data” increases the file size but decreases the run time cost (as we don’t need to do any operation run-time, we can directly use the data we extract). As stated in last week’s assignment, players care more about the run time than build, hence this choice.
Game Screenshot
Playable EXE Download
Controls: 
         
W S A D to move game object.
        Up Down Left Right to move camera.
        Ctrl to switch the mesh of game object.
        Space to hide one object (plane).
Picture
0 Comments

    Author

    Write something about yourself. No need to be fancy, just an overview.

    Archives

    November 2018

    Categories

    All

    RSS Feed

FOR ANY FURTHER DETAILS


Telephone

801-859-1131

Email

Resume
File Size: 227 kb
File Type: pdf
Download File

Visit Hard Light Vector
[email protected]
Git Hub
  • Projects
    • Hard Light Vector
    • Memory Manager
    • Samurai Crusader
    • Dyslexia VR
    • Geriatric Depression Suite
  • Prototypes
    • Game Mechanics
    • Diana's Inferno
    • MakeUp & BreakUp
    • 10Pest
    • Ninja Pinball
  • Blogs
    • Sic Parvis Magna
    • Game Engineering - Week 1
    • Game Engineering - Week 2
    • Game Engineering - Week 3
    • Game Engineering - Week 4
    • Game Engineering - Week 5
    • Game Engineering - Week 6
    • Game Engineering - Week 7
    • Game Engineering - Week 8
    • Game Engineering - Week 9
    • Engine Feature - Audio Subsystem
    • Final Project - GameEngineering III
    • AI Movement Algorithms
    • Pathfinding Algortihms
    • Decision Makiing
  • About