CSS552: Programming
Assignment #3
Shadow and Secondary Illumination
Due Time: Refer to the course
web-site.
Objective
The
goals of this programming assignment are for us to implement, experience, and
understand the global illumination effects: shadow computation, reflection, and
very simple refraction. Here are more details.
Approach
Please
refer to my solution. Here are the command files (with sample test cases). You
should download and unzip both of these files, then double click on RTViewer to run the sample program. Notice that in
this version of the ray tracer you are to extend your Phong illumination model
from mp2 to include support for shadow, reflection, and the simplest support
for refraction computation. Please download this
starter project (my mp2 solution) and unzip the source code. Here are some
important hints to the source code:
The RayTracer Project: RTCore_Init.cs
Notice the new loop to initialize all lights. This is where shadow depth map
should be computed (before rendering computation actually begins!).
RTLightType:
- InitiailizeLight: Notice RTLightType_Spot: now override this function and
attempts to "initialize". If depth map is switched on, you
should compute the map.
- PercentVisible(visiblePt, exceptGeomIndex,
sceneDatabase): This function should
determine if the light source is blocked from "visiblePt",
with the exception of exceptGeomIndex (why?),
and if so, what "percentage" of the light is blocked (when depth
map filtering is enabled).
- DistanceToLight(visiblePt): This function should
return the distance between the visiblePt and
the light position. This is to avoid the shadowing of objects behind the
light source problem (refer to the ppt at the
end of this assignment specification). How would you handle the situation when
a light does not have a position (i.e., Direction Light)?
Credit Distribution
Here
is how the credits are distributed in this assignment:
1. 15%:
Reflection
2. 20%:
Refraction
- 25%: Shadow: Ray trace point sampled
- (10%) Point light
shadow
- (10%) Directional light
shadow
- (10%) Spotlight shadow
- 35%: Shadow Depth Map
- (10%) Proper
computation of the map with visible ray casting (like MP1 all over
again!)
- (15%) Proper use and
lookup of the depth map during ray tracing
- (10%) Proper support
for depth map filtering
- 5%: Cleanup MP2 GUI check boxes
- Force you to take a
little look at the GUI aspect of our system. You only need to figure out
what are the lines to delete.
- 5%: Proper submission
- No useless files
- Proper name of zip
file.
Extra Credits
- 3pt: Support specification of shadow color where your user
can say they want shadow to be e.g., in color of red (instead of black).
Interesting (or
not) potential bug
·
Refer to this ppt, light source closer than object!
This programming assignment will count 15% towards your final grade for
this class.