| Assignment 2: Wireframe techniques, Fog and Programmable Shaders |
Rendering using several different wireframe modes | ||
![]() |
The screenshot on the left shows a basic scene setup. There are three simple models loaded. The camera can be rotated around the scene to allow different viewing configurations. | |
![]() |
The user can right click on the OpenGL display area and access a whole bunch of options for each of the rendered models. The menu options allow the user to change the model type, the shader program that is used to shade the object, the standard material type and the wireframe mode. |
|
![]() |
The screenshot on the left shows a simple model rendered using standard OpenGL polygon line fill mode. |
|
![]() |
The screenshot on the left uses a slightly more advanced techinque to display the wireframe. It essentially removes the hidden lines. Observe that, since my program renders objects in back-to-front order you can actually see through the wireframed object. |
|
![]() |
The screenshot on the left shows a model rendered using haloed lines. |
|
| | ||
Fog | ||
![]() |
The screenshot on the left shows a basic implementation of fog. The background clear color for this scene has been changed to white for better looking fog :). |
|
| | ||
Loading and using Programmable Shaders | ||
![]() |
The screenshot on the left shows a shader from 22C:151 applied to the floor. The user can use the '+' and '-' keys to change the scale factor. |
|
![]() |
The screenshot on the left shows the view angle shader applied to a simple object. The more a face faces towards or away from camera the higher the transparency on the face. The eye-space normal for each vertex is computed in the vertex shader and is passed down to fragment shader where the actual computation is performed. Performing these calculations in our fragment shader gives us finer control over per fragment alpha value which results in smoother looking images. |
|