Thursday, January 17, 2013

Game Graphics Assignment 1


This assignment was mainly about learning to use the pipeline that John-Paul made. To be able to create another project tool and get it working with the pipeline. then to make some change to the vertex and pixel shaders.
The pipeline was different, but not too hard to understand. All of the rest (creating my own file format and shaders) i have done before. So overall the assignment went smoothly.

Link to code

Everything should be working. the vertex shader puts a sin wave through the position and moves them left and right (+- x value) based on the position on the screen. so the closer to the top the more it sways, and when it goes below the middle it sways the other way.
The pixel shader takes the color from the vertex shader (which is the x and y value as the red and green) and multiplies it by a sin wave so that the rectangle fades in and out.

The format for my "mesh" file is as follows.
[number of tries]
[x 1-1] [y 1-1]
[x 1-2] [y 1-2]
[x 1-3] [y 1-3]
--------------
[x 2-1] [y 2-1]
[x 2-2] [y 2-2]
[x 2-3] [y 2-3]
--------------


the line with the "------------" is a trash line for ease of reading, the parser just reads that line and forgets it. that also means that line could contain things line the name of the object and which triangle number that is. But atm it just separates the triangles.
Here are screenshots of debugging the vertex shader and pixel shader in Pix.


No comments:

Post a Comment