Lab 10: Optional Extensions
For this lab, we added two features to our graphics engine: supersampled jitter antialiasing and hierarchical modeling of lights.
Procedure
We added several minor utility methods and three major interface methods to Prof. Maxwell's Graphics Environment Specification.
- Image* Image_aa(Image *src, unsigned int factor) jitter-downsamples an image by factor in each dimension and returns a pointer to the antialiased image.
- Module_light(Module *md, Light *l) inserts a light into a hierarchical model. If the LightType has a position, the position is taken to be in model coordinates.
- Module_shadeLightfind(Module *md, Matrix *VTM, Matrix *GTM, Color bodyColor, Color surfaceColor, float surfaceCoeff, int numLights, Light *light, Point *viewer, Image *src) finds all lights in md, transforms them to world coordinates if applicable, and draws the scene with Gouraud shading using both the discovered lights and the lights passed in.
Results
David's Portfolio Images
Image 1. The mobile of Labs 8 and 9,
rendered at 2000x2000 and antialiased 16:1,
with hierarchically modeled lights
at the top of the stem of each bauble. Note particularly
that the illumination of
the green bauble changes as the lights on the red and blue baubles move.
Conclusions and Future Work
We didn't quite do everything we wanted to do, but we are content.
Appendices
Our code is available with AES256 encryption. The passphrase is only available to Dr. Maxwell.
Antialiasing was sort-of pair-programmed. While David implemented hierarchical modeling of lights, Allison slept for a while, then woke up and read a book. David wrote this writeup, except for the previous sentence, which Allison dictated.