Assignment 1
Advanced Texturing and Shadowing

Description

In this assignment, you are required to render a scene with various texture techniques, shadowing and planar reflection.

The Scene

There are 13 objects and 12 materials in the scene. Here is the scene file in Wavefront OBJ format and texture images needed scene.zip.

  • The Wall object is the wall around the room, a bump map texture "Bump_Wall1.tif" is applied on it.
  • The Ceil object is the ceil of the room, it consists of a material with grey diffuse color.
  • The Floor object is the floor of the room, which consists of a material with green diffuse color.
  • The Column object consists of 4 pillars in the room, which is textured by the Marble material.
  • There are a Box and Terrain objects in the center of room, the Box object is textured by the Marble material. Two textures are applied on the Terrain object, one is a color map "ps_texture_1k.tif", and another is a displacement map "ps_height_1k.tif".
  • There are two Monet's paintings on the wall, each painting is combined with two objects, a Painting object and a Painting_Border object. The Painting_Border object is textured with Wood materials.
  • There are also two mirrors on the wall, wach mirror is combined with two objects as the same as the painting. You should implement the planar reflection on the two mirrors.

There are two point light sources in the scene, the position of two lights are (0.0, 1.2, 2.2) and (1.2, 1.2, -2.7).

For more detail description of the Wavefront OBJ format, see the wab page:
http://netghost.narod.ru/gff/graphics/summary/waveobj.htm

Followings are several images for the scene. All images are rendered using 3D Studio Max.


A top view of the scene, the shadows casted by the two light sources should be very clear.

A view of planar reflection, you can see the recursive reflection between two mirrors.

A view of the painting.

A view of another painting.

A close view of the terrain, see the effect of displacement map and color map carefully.

Requirement

The basicest requirement

  • The color map and the bump map of the scene should be rendered well.
  • Modify the Terrain object geometry to fit the displacement map, and then renders normally as geometry data.
  • Firse level reflection of two mirrors.
  • Shadowing using projective texture mapping.
  • Per pixel lighting for illumination calculation.

For advanced issues, following features are bonus.

  • Displacement mapping using either multi-pass rendering or programmable graphics hardware.
  • Spot lights on two paintings using projective texture mapping and light map.
  • Recursive reflection of two mirrors.
  • Dynamic shadows using shadow volume or shadow map.
  • Planar reflection with bump mapping (ex. a ripple on the mirror.)

Hint

Terrain

First, you need to write a vertex shader program to raise the vertices of terrain mesh base on the height map. Since the geometry has been changed, the normal value for each vertex should be recomputed. One efficient way is to create a normal map of the terrain mesh in preprocessing time and uses for normal look-up at run time.

One alternative way is to modify the terrain geometry and normal using any modeling tool (Maya, 3D Studio, ...), and renders with color map at run-time.

Mirrors

The two mirrors are the same size with width 1.0 and height 1.2, both are parallel to the YZ-plane and face to each other. The center of the two mirrors are located at (-2.95, 0.0, 0.0) and (2.95, 0.0, 0.0).

The easiest way to implement the planar reflection is using the stencil buffer. See the OpenGL programming guide or other tutorials for more detail description about the planar reflection. To perform the reflection between two mirrors, a recursive architecture is needed.

Wall, Ceil and Floor

The per fragment lighting calculation is required for wall, ceil and floor mesh. The easiest way to perform per-fragment lighting is to write a fragment (pixel) shader program for light calculation. See the nvidia's developer website for more detail about the per-fragment lighting.

There is a bump map attached with the Wall mesh. a simple way to implement the bump mapping effect is to convert the bump map into a normal map, and then apply the normal map to the origin normal value to get its real value after a offset. This can be integrated into the per-fragment lighting.

Other objects

Other objects can be rendered with the color texture map. But you may also use a shader or multi-pass procedure to make the paintings or the marble material more realistic.

Shadow

There are various way to implement the shadow, see the nvidia's developer webpage or here for more detail.

Related Links

developer.nvidia.com
This is the NVidia developer website. All technical data about the NVidia graphics chips can be found here. They also provides lots of useful resources of the programming issue of the OpenGL and Direct 3D features (both documents and source codes).

www.cgshaders.org
This is the official site of CG (C for Graphics) language. The CG language is proposed by NVidia as a high level language for programmable graphics hardware. Lots of shaders can be found in this site, which is very useful if you wish to implement the assignment using programmable graphics hardware.

www.libtiff.org
Documents and source code about the TIFF image format. The TIFF image format is used to save the texture data in the asignment.

www.imagemagick.org
Another image processing library. The ImageMagick provides a common image loading and saving interfaces for most well known image formats.

GLEW
This is a good library to help you initialize the OpenGL extension function.

Books

The CG Tutorial

OpenGL Shading Language

Copyright ©2004 by CGGM Lab. All Rights Reserved. All trademarks are acknowledged to belong to their respective owners.