GPU Programming for Video Games
Homework #5: Portfolio-Quality Postprocessing
Due: Friday, July 25 at 23:59:59 (via T-square)
The main goal of this assignment is to have fun! If you are not having
fun with this assignment — you’re doing it wrong. 🙂
In this homework, you will write one or two postprocessing shaders
implemented using “ReadPixels,” using the “Advanced
Post Processing Demo” code from Session 19 on the class website
as a starting framework.
You may write one postprocessor that uses both depth and normal
information in an appropriate way, or two postprocessors, one using
depth information, and another using normal information.
Create a Unity scene (or scenes) that
effectively demonstrates how interesting your postprocessing effect is
(or effects are) using free 3D models
from the Unity Asset Store.
Your shaders(s) should include some kind of spatial aspect that
can only be implemented in a postprocessing stage; i.e. don’t
just have a pixel’s postprocessed color determined only by the
input values at that exact pixel location. (Such shaders are useful,
but too simple for what we want here).
As a general guideline,
the more specialized your shader is,
the better; that may help ensure a variety of different
shaders so I won’t get bored while looking through them.
(But that’s much more of a vague suggestion than anything
resembling a rule.)
The goal is to create something that you would be proud enough of to
include on a website portfolio that you would point a potential employer
too, but also simple enough in scope that you can complete it in the
given time frame.
There are countless shaders available in books, papers, and blogs; you
should draw inspiration from these without copying any of them directly.
A guilding principle is that your shader should be sufficiently original
that you could sell it on the Unity asset store without worrying that
someone might accuse you of plagarism. (Of course, for some common
one-line formulas, there are only so many ways write them.) Be sure to
properly cite your sources!
Possible approaches for getting started might include:
- Implementing a technique from a paper or presentation that is described
in terms of regular mathematical notation instead of shader code, i.e.
turning the math into code.
- Reading the description of a not-free postprocessor on the Unity
Asset Store, and then trying to come up with something along the
without actually buying the shader and looking at its code.
- Coming up with something completely original (this should still be
“meaningful” in some way;
make it something that someone besides you might want to use).
Whatever sources you are drawing from, be sure to put your own “twist” on it,
for instance, making additional paramaters tweakable via custom textures.
If you are in the CS game development class, you are encouraged (but of course
not required) to make postprocessor(s)
that would be appropriate for your game.
Note that it should be a shader
(or shaders) that you wouldn’t ordinarily bother writing
for that class. The same overall idea applies if you have your own game
in mind that you might want to write someday, even if it’s not for a
Unity defaults to using Shader Model 2.0; if you need to, go ahead and
use a #pragma to set the shader model to 3.0 or higher. Use the
shader model you can get away with; that way your shader could target
the largest number of platforms.
For this assignment, you need not put much effort into trying to optimize
your shader; just don’t write any code that is blatantly rediculous.
Like the last assignment,
on this assignment,
you will turn in a unitypackage.
Take a couple of screenshot demonstrating your fantastic shader(s)
and include them in your unitypackage (you can just drag and drop the
screenshot onto your top-level Assets folder). Include a readme file briefly
describing what you did, what sources you drew inspiration from, etc.;
please also place that in your Assets folder.
Export your project as a unitypackage (use the Assets->Export Package
menu option, and be sure to have “include dependencies” checked.)
It is strongly recommended — but not required — that you
briefly discuss your ideas for this assignment with Prof. Lanterman,
either in person or via e-mail, before you spend too much time working
on the actual coding.
unityproject to T-square.
Include “HW5” and as much
as possible of your full name in the
filename, e.g., HW5_Aaron_Lanterman.doc. (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 Prof. Lanterman at email@example.com,
with “GPU HW #5” and your full
name in the header line;
use this e-mail submission as a last resort if T-square isn’t working.
If the file is too big to e-mail, see if you can upload it to one
of your web spaces and e-mail Prof. Lanterman a link, again with “GPU HW #5”
in the header.