CIS 788A Advanced Compositing, Texturing and Volume Rendering
Lab 1 (Option 2): Rendering Glass: Specular Highlights, Texture Mapping and
Transparency in OpenGL
Objectives
This will be a short and simple lab to examine issues associated with rendering
correct opacity and specular highlights using OpenGL and programmable shader
capabilities. We will assume a constant colored background and ignore any refractions
in the glass, however, test your results on constant as well as non-constant
backgrounds to better analyze the compositing. New features in OpenGL 1.4 allow
for a separate specular color to be carried forward until after texture sampling,
however, the interaction between this and textures having an opacity channel
need to be examined. Correct compositing requires a front-to-back or back-to-front
sorting of the graphics primitives. We will look at the many possible ways to
achieve correct opacity accumulation and the precision issues in modern graphics
GPU's. Examine the various blending formulas and operations to achieve special
effects. In short, play with blending, play with specular highlights and play
with textures (in particular, non-decal textures).
Tasks
- Develop a program that will read in a object file (OBJ, DXF, etc.) and an
associate texture map / atlas.
- Your program should have the familiar set of user interactions, rotate,
translate, zoom
- Add a user interface to place point light sources or spotlights on a sphere
surrounding your object.
- Research the Separate specular functionality of OpenGL.
- Experiment with the various blending operators and factors.
- Try to determine a new method for handling the opacity near silhouette edges
Ideas
- Try using Pixel Masks via textures and an alpha test to get specular highlights
on the opaque regions only.
- Use environment mapping with an opacity texture to make the edges of the
glass more opaque.
- Use fin textures (aka from shell and fin rendering) to add more opacity
near the silhouettes.
- Consider using the GL_MIN or GL_MAX blending modes to shade silhouette edges
(for opaque objects), by playing with the lighting and material properties.
Results
Last Modified by Roger Crawfis,
April 5, 2004