# GPU 2014 — Homework #5

GPU 2014 — Homework #5

# GPU Programming for Video Games

## Due: Friday, July 31 at 5:00 PM (via T-square)

This is Part B of a two-part assignment.
Students in the 8xxx graduate sections will do Parts
A and B, but students in the 4xxx graduate section will only do
Part A.

This assignment won’t be as much fun as part A, but it should at least
be interesting. ðŸ™‚

1) Write a surface shader the implements the specular Cook-Torrance
model consisting of a microfacet distribution term, the Fresnel term,
and a geometry term. To focus on the Cook-Torrance model, we will leave out
the diffuse term in this assignment. Implement two possible
distribution terms, and
use a Range(0,1) slider to lerp between them. For variety, don’t
implement the GGX distribution term, since that’s given in the slides
(but one of your terms can be Blinn-Phong).
Implement two possible
geometry terms, and use a Range(0,1) slider to lerp between them.
Experiment with your sliders to get a feel for the effect of different terms.

2) Make a scene consisting of a few interesting objects. Take
four screenshots, one for each possible combination of
distribution and geometry terms (with the objects in your scene in the
same locations and positions, with the same camera parameters, etc., for
each screenshot to facilitate accurate comparison).

3) Using a tool such as MATLAB, Mathematica, Excel, etc., make a plot
of your distribution terms as a function of the cosine of the
angle between the normal
vector and the half vector (i.e., n dot h, which ranges between 0 and 1).
Put both curves on the same plot
to aid in comparison.

4) Comment on what differences you observe in the behavior of the different
models. Are they quite different, or barely noticable? If one took more
computations than the other, would it be worth the extra computation?

Deliverables:
into a single Microsoft Word document or PDF file
(using whatever tools you wish to create a PDF). For Problem 1, include your
complete shader code. For Problem 2, include your screenshots. For Problem 3,
include the plot. Problem 4, include your brief text.
Include “HW5B” and as much
as possible of your full name in the
procedure should be reasonably self explanatory once