LSU EE 4702-1 Homework 4 Due: 7 November 2014
LSU EE 4702-1 Homework 4 Due: 7 November 2014
LSU EE 4702-1 Homework 4 Due: 7 November 2014
The solution code is in the repo in file name hw04-shdr-sol.cc. If you pull and make you can
run the solution by executing hw04sol. An html version is available at
https://www.ece.lsu.edu/koppel/gpup/2014/hw04-shdr-sol.cc.html. Note that the git ver-
sion is always the most up to date.
1
For the names of the predefined material property uniforms
available in the fragment shader see Section 7.4.1 in the OpenGL
Shading Language spec version 4.5. To determine whether a frag-
ment is from the front or the back of a primitive see Section 7.1 in
the spec.
(b) The surface of the spiral shows a draft this homework assignment handout, using black for the
text and yellow for the background. Modify the fragment shader so that there is no spiral wherever
the texture is black (or a dark color). In other words, modify it so that you can see through the
spiral wherever the texture is black.
To determine if a texel is dark add up the red, green, and blue components and check if the sum
is less than .05. If a texel is dark, then prevent the corresponding fragment from being written. To
see how to prevent a fragment from being written see Section 6.4 in the OpenGL Shading Language
spec version 4.5. (This section describes jump-like statements in the shading language.)