Joshua Andersen

CS6610 Final Project Proposal

 

This program uses openGL and glut to render a scene of a room with an animated semi-transparent box in it.

 

Major features

 

Basics of how the lighting works

These two textures are stored as clamped and used to compute the per pixel lighting.  The register combine is used to attenuate over distance from the vertex to the light position.  The 2D texture is mapped on to the polygon from s,t.  The 1D texture is mapped from r coord.

 

Distance is computed by:

 

                    x0 = (x - lightX) / Brightness
                    y0 = (y - lightY) / Brightness
                    z0 = (z - lightZ) / Brightness


Distance is scaled by dividing it by the light brightness (or light radius, which lies in the -1 to 1 range) The next step is to map these (x0, y0, z0) distances which lie in the -1 to 1 range into (s, t, r) texture coordinates which lie in the 0 to 1 range.

                    s = x0/2 + 0.5
                    t = y0/2 + 0.5
                    r = z0/2 + 0.5

 

                      

 

 

     2D Texture to limit the light on the plane                                       1D Texture used to anneuate the light by distance 

 

 

 

Picture of the lighting in action                                                               Just the light (blended with base textures for picture on the left)

 

A brighter red colored light                                                                   The ambient light is red this time with the point light being white

 

 

Example of multitexturing

 

This is the texture sequence that is used for the ceiling in the room.

 

Base diffuse texture                                                    Detail (Would be a height map if bump mapping)        Final polygon after multitexturing

 +  =

 

 

Compressed textures

 

Using .dds textures I was able to load 1024x1024 textures that would usually take up more than 6MB but with the compression they are only 1.3MB.  This allows for much higher resolution textures and higher performance.

 

Anisotropic Filtering

 

By enabling anisotropic filtering on the GeFore cards great texture detail can be gained at oblique angles.

 

Anisotropic Filtering enabled                                                                 Without Anisotropic filtering

 

The more oblique the angle is to the viewer, the more extreme the difference                  Without filtering, notice the left wall how blurry it is compared to the image on the left

 

 

Bump Mapping

 

Though not exactly working it still does show a good amount of depth.  This blends a normal map with a diffuse map to add the illusion of depth.

 

Movie of this program in action

Lighting.avi

*Need Divx 5.02 to view the movie