Monday, September 28, 2009

Assignment #3

Phong shading:


Bump mapped:


The normal map generated from the height map shown in object space:


The position map shown in object space:



Reflection. The reflected color is lerped with the bone_map texture using the reflectivity as the weight:


Refraction. The refacted color is lerped with the bone_map texture using the transmittance as the weight.


The tangent frame was computed using the baked position map. For a given texture coordinate, the position in front and in back of the current position was taken and their difference computed.

From this, the tanget vector was computed as (1, 0, dx/ds ), where dx/ds is the difference in the x position the s direction for a small delta.

Environment mapping was done using a cube map loaded from a Direct Draw Surface. The reflection and refraction vectors were calculated and projected into the cube map using the texCUBE function.

Seams in a map were handled by looking for a zero magnitude vector being retrieved from the sampler. If this happened, the derivative was taken using either a forward or backward looking sample as opposed to using a centered sample. Admittedly, I didn't notice any change in image quality when I did this.

Frame rates were usually between 90-110 frames per second.

No comments:

Post a Comment