Assignment 2 -- Due 2/28/08

Jonathan Hall


Problem 1:

Implement various wire frame effects such as hidden line removal and haloed lines.


Normal Version Wireframe Mode Hidden Lines Removed
Scene with out any effects Simple wire frame using glPolygonMode Lines behind an object are hidden using the depth buffer and polygon offset.
Lines with Halos A zoomed view to part d
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

A Kryptonite 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

Two shaders are enabled

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).

(Click pictures for full view)