CIS 788A Advanced Compositing, Texturing and Volume Rendering
Lab 1 (Option 1): Sprite Engine - Spatial Partitioning and Compositing
Objectives
This will be a short and simple lab to examine post-rendering compositing
using a spatial partitioning scheme. Consider a simple case, where we divide
the view-space into front-to-back slabs. This can easily be accomplished by
setting front and back clipping planes (there are some problems here, think
about it). Render each of these slabs separately, obtaining RGBA textures for
each slab. Develop a Region (partition or layer) manager and a Sprite compositor.
Experiment with other spatial partitionings, or more generally, regions of interest
(ROI's) and their resulting sprites. Your sprites should have a bounding box
in some consistent space (viewing space), a depth location, and an order ID
specified by the Region Manager. Add support for Sprites with depth. Assume
the final composition has opaque geometry rendered using the z-buffer, and a
z-test (but no set) should be performed in the compositing. Consider the case
where the sprites are at a different resolution(s) from the final image, in
particular, a higher resolution to avoid aliasing or resampling problems). Since
we have machines with 128MB of texture memory, develop your algorithms to avoid
reading back into memory whenever possible.
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.
- Develop a layer (or slab) partitioning and compositing. Add a user interface
for a) highlighting and b) selecting an individual layer. Write the resulting
layers out to a TIFF files (with layers) and/or Photoshop format. I believe
DevIL (http://openil.sourceforge.net/) supports this for tiff files. If not,
you can just write them to a sequence of files foo0001.tif, foo0002.tif, ....
- Add a user interface to highlight and select the individual sprites:
- Add a low-opacity plane behind the sprite
- Draw the bounding box
- Double the opacity of the sprite.
- Saturate the sprite opacity with some minimum opacity alpha = max(highlight,
sprite).
- Enlarge the sprite about its center
- Decrease the opacity of all the sprites in front of the one being highlighted
(limit this to just the sprites bounding box?)
- Add a user interface to change the sprite compositing order:
- move forward, to top, to bottom, etc. or
- select (list box) and then move up or down in the list.
- Consider different ROI's.
- Regular grid partitioning
- Stencil mask and z-buffer initialization
- To get a spherical ROI, set the z-buffer for the front and render
with front clip plane at the center. Reverse and render front half.
- Use the teapot as a stencil mask.
- Sorting of disjoint bounding boxes.
- BSP-tree partitioning of disjoint objects
Results
Last Modified by Roger Crawfis,
April 5, 2004