ECE4893A/CS4803MPG: Multicore and GPU Programming for Video Games

Fall 2008

Homework #5: Shaded First Person Shooter

Due: Wednesday, Nov. 5 at 23:59:59 (via T-square)

Late policy: The homework will be graded out of 200 points. We will accept late submissions; however, for every day that is it is overdue (including weekend days), we will subtract 30 points from the total. (We understand that sometimes multiple assignments hit at once, or other life events intervene, and hence you have to make some tough choices. We'd rather let you turn something in late, with some points off, than have a "no late assignments accepted at all" policy, since the former encourages you to still do the assignment and learn something from it, while the latter just grinds down your soul.)

In this assignment, you will create a first-person shooter that employs a sophisticated rendering effect such as shadow mapping or normal mapping, as well as a post-processing effect. The main purpose of this assignment, besides getting practice with creating shaders and integrating them through an API, is to create something awesome that you can demo for potential employers.

This assignment is much more ambitious than the previous ones, so do not wait until the last minute to start it. We are giving you two weeks for a reason.

The basics: Staring with Prof. Lee's most excellent DungeonShooter code as a base (see the link under Session 20 on the main class webpage), develop a simple "first person shooter" game with the behaviors described below:

Concerning the adaptation of Prof. Lee's code:

Your game does not need to have...

Of course, we are hoping you will have fun with this assignment, so if you want to add various enhancements and have time, go to town!

The 3-D shader part: Enhance your game in one of two ways:

  1. Have the enemy cast a shadow via the shadow mapping technique discussed in lecture. If you take this approach, you may want to adapt code from one or more of the following examples (be sure to give credit in your comments): To keep things simple, you only need to have one of the lights cast shadows, and you only need to cast shadows on the floor. If you can do something more sophisticated, go for it, but it's not required.
  2. Make the floor look much cooler by applying normal mapping to it. (Notice I'm suggesting the floor since applying normal mapping to a plane is much easier than appying it to an arbitrary surface.) This will involve re-writing Prof. Lee's multi-light shader to operate in a Phong style instead of a Gourard style; i.e. you'll need to shift much of the lighting computation from the vertex shader to the pixel shader. You can find some normal maps online (just do a google search on "normal maps") - look for images where the x, y, and z are coded as red, green, and blue. Or, you could try creating your own normal map somehow.
Instead of one of the two possibilities above, you are welcome to propose some sophisticated shader effect of your own devising. It must be similiar in complexity to shadow mapping and normal mapping. Before embarking on an alternate path, be sure to discuss your proposal with Prof. Lanterman to make sure your proposed shader is sufficiently complex and get his approval.

The 2-D postprocessing part: Add a cool non-trivial postprocessing effect to your game, something that makes sense within the context of the gameplay. It might be an effect that runs all the time, or when the player fires, or when the monster is hit, or when the player dies; or, if you've gone all-out an implemented some non-required gameplay enhancement, it might be associated with that enhancement. By non-trivial, I mean that it shouldn't just pixelwise change the colors without some sort of interesting inter-pixel interaction (i.e. don't do something like just swap red and green or get rid of all the blue). You are welcome to adapt code you find on the web or in books and such, as long as you give the original author appropriate credit in your comments.

Discussion board: As an experiment, we have set up a "HW #5" discussion board where students can discuss the homework and in particular ask questions that the professors and other students can help answer. (Try to avoid posting significant chunks of code on the discussion board; those are probably best directly e-mailed to the professors.)

Who to ask questions of: Questions about the operation of the DungeonShooter code should be addressed to Prof. Lee. Questions about the requirements of the assignment should be addressed to Prof. Lanterman.

Deliverables: Package everything needed to compile and run your game (3D data file, textures, code, etc.) and upload them to T-square as a zip file or gzipped tar file. Include "HW5" and as much as possible of your full name in the filename, e.g., HW5_Aaron_Lanterman.zip. (The upload procedure should be reasonably self explanatory once you log in to T-square.) Be sure to finish sufficiently in advance of the deadline that you will be able to work around any troubles T-square gives you to successfully submit before the deadline. If you have trouble getting T-square to work, please e-mail your compressed file to lanterma@ece.gatech.edu, with "MPG HW #5" and your full name in the header line; please only use this e-mail submission as a last resort if T-square isn't working.

When you submit your homework, please tell us an approximate number of hours you spent working on it, as well your thoughts on the homework, particularly suggestions for improving it in the future. (If you don't have any suggestions, that's OK, just tell us an approximate number of hours.) This will help us with future offerings of the class.

Ground rules: You are welcome to discuss high-level implementation issues with your fellow students, but you should avoid actually looking at one another student's code as whole, and under no circumstances should you be copying any portion of another student's code. However, asking another student to focus on a few lines of your code discuss why a you are getting a particular kind of error is reasonable. Basically, these "ground rules" are intended to prevent a student from "freeloading" off another student, even accidentally, since they won't get the full yummy nutritional educational goodness out of the assignment if they do.