Implement various wire frame effects such as hidden line removal
and
haloed lines.
Scene with out any
effects
Simple wire frame
using glPolygonMode
Lines behind an
object are hidden using the depth buffer and polygon offset.
Lines in front of
other lines exhibit a clear halo that indicates line
ordering. This is accomplished similarly to the previous, but renders
thick lines to the depth buffer.
A zoomed version
of the previous. Here the halos are more easily seen.
(Click pictures for full view)
Problem 2:
Enable Fog
Here we have fog enabled. Notice the back of the scene is greener
then the front. Al is looking pretty green, but the sphere is
relatively unaffected. This is exponential 2 fog where the fog
increases at an exponentially squared rate.
(Click pictures for full view)
Problem 3:
Implement some interesting sharers
I have created two sharers -- a sinusoidal pattern on the floor
and a eerie ghost effect on the objects. The floor patten is a fragment
shader whose pattern can be adjusted at run time. The shader on the
objects is a vertex shader which changes the alpha color component at
each vertex depending on the angle between the viewer and the normal at
that vertex. I used the formula (0.5 * sin(theta) + 0.5)^3 which
is 0 when theta is 0 (vectors are parallel) and 1 when theta is pi/2
(vectors are perpendicular).