CS513 Assignment 2: Shadows
by Muhammad Karim
General Configurations:
   # Development Platform: Visual C++ 2008, Debug+Release build
   # Used OpenFrameworks library
   # Graphics Hardware: ATI Mobility Radeon HD 3470 (OpenGL 2.1)
Deliverable Notes:
   Used OpenFrameworks to create windows, load images etc.
   Used OpenGL extension: GL_EXT_framebuffer_object for creating depth map.
   Used nVidia cg as the shading language.
   Used 24 bit depth buffer for the shadow map with Resolution: 1024x1024.
  
-
Shadow Map Results:
Screen-shot of a generated image:
Screen-shot of an image with a debug window showing the generated map:
Screen-shots comparing depth map comparison tests with or without bias:
| No bias |
Some (0.006f) bias |
|
|
Source Code:
Project (contains Win32 executable)
Shaders are located in "/bin/shaders/"
Project with OpenFrameworks codes (required for compilation)
-
Discussion:
I have used the cg build-in function tex2Dproj to do depth compare initially, then did the computation manually in
the fragment program. If tex2Dproj is used then I had to pass in extra parameters for the FBO texture to indicate
the depth compare function.
I used a 24 bit floating point texture for the depth map with reasonably large size for the scene (1024x1024).
Adding some bias in the depth compare code (in the
fragment program) reduced some significant aliasing. However, still a lot of aliasing were present in the scene.