Robert Kooima - CS594 Final


This tutorial describes in detail each aspect of the creation of a scene centered upon a dilapidated billboard somewhere in the desert southwest. We'll see how foreground and background geometry combine with sky and lighting effects to form a coherent scene in both day...

... and night.

Many of the details of the implementation are omitted from this discussion. It is assumed that any reader looking to implement the techniques presented here will already be familiar with the particulars of OpenGL application initialization, extension management, and texture and object loading. Where appropriate, links to further information are provided.


We proceed in four parts, with each part building on the previous. All of the demo screen shots and code samples included in each of these four parts are taken from the final version of the demo, provided below.

  1. Scene Geometry
  2. Day and Night Skies
  3. Illumination
  4. Added Detail

This document presents several examples of GLSL vertex and fragment shaders. We distinguish these two as follows. Vertex shader code appears in green:

void main()
    gl_Position = ftransform();

Fragment shader code appears in yellow:

void main()
    gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);


The demo source code including all models, shaders, and textures may be downloaded here. It has been built and tested under Windows XP, OSX, and Linux. Visual Studio 7 project files and a Unix makefile are included.

Demo controls:

Left drag

Rotate the view

Right drag

Rotate the sky

Mouse wheel

Zoom the view

Space bar

Toggle the passage of time


Toggle wireframe view




Flush and reload all configurations and assets



[Introduction] [Part 1: Scene Geometry] [Part 2: Day and Night Skies] [Part 3: Illumination] [Part 4: Added Detail]