CS513 Assignment 5.1: Transparent Frank (Last Updated Nov 07, 2009)

by Muhammad Karim

General Configurations:
   # Development Platform: Windows 7 x64, Visual Studio IDE, Debug+Release build
   # Used OpenFrameworks library
   # CPU: Intel Core2Duo 2.24 GHz
   # Graphics Hardware: ATI Mobility Radeon HD 3470 (OpenGL 2.1)

  1. Transparent Frank Results

    Transparent Frank with Transparent Shadows


    For the fragments that light cannot see, some light passes though after being attenuated based on the density coefficient (rho) of frank's body material. I eleminiated some artifacts using an epsilon value added with the depth read from the Light Depth Buffer.

    Transparent Frank with Transparent Shadows with Channel Specific Rho(rgb)


    This time frank's fragments (that are occluded from light) were attenuated based on different rgb coefficients for rho (100, 100, 400), so more blue light is passed through.

    Debug Image from Frank with Transparent Shadows


    A debug image showing how much light is passed though based on the difference abs(fragment_depth_from_eye - fragment_depth_from_light). Some Artifacts were present here.

    Transparent Frank based on Thickness


    As evident by the image thicker regions (chest) on frank are less transparent than thinner regions (hand).

    Debugging Transparency Values on Frank


    My shader has some artifacts as of this point, but it works for most areas on frank.

  2. Discussion:

    1. First, frank's farthest fragments were rendered into a depth buffer (Farthest Fragments Buffer = FFB).

    2. Then, this FFB was into the transparency shader wrote for frank. This shader picks the far depth from FFB by projecting the transformed point as a texture coordinate onto the FFB texture (just like Shadown Mapping). The z depth of the current fragment is calculated by a similar projection technique on the current projected vertex.

    3. Then the thickness d is calculated from the difference of these two depths.

    4. A constanct value for rho is picked (128, 256 ..) and the transparency value is calculated from exp( -d*rho ).

    5. So this gives me the transparency of a fragment based on thickness (more thickness gives a low transparency). Then I set the alpha (opacity) component of the final color to (1.0 - transparency).

    6. Finally, Frank is drawn after all opaque objects with a blend function: Csrc * Asrc + Cdst * (1 - Asrc);

    7. Update: Transparent shadows have been implemented for frank's density rho values. A depth map was rendered for Frank from light's point of view.

    8. For the fragments that are occluded from light (as if light passed though frank and coming out of these fragments) a transparency value is calculated for rgb channels. This was used to attenuated the light intensity (after they travelled through frank's body).

    9. For point that are directly visible from light the tranparency calculated from the FFB were used.