CS155 - Fall 01

Z Sweedyk


Project 2: Ray Tracing Examples


The project description recommends an order of implementation of the project features.  These test files and resulting images correspond to this order.
 

Test 0.
For this test you need to cast rays, compute interesection points for spheres and triangles, and compute ambient color.

        Test file:  r0.ray             Image:        
 

Test 1.
For this test you need to implement diffuse lighting for a directional light. The direction of the light is constant throughout the scene. The reflection at a point on a surface depends on the angle between the surface normal and the direction of the light.  Notice the shading on the sphere.  At this point we have not implemented shadows.

       Test file:  r1.ray             Image:             
 
Using the same test file with shadows implemented produces the following image.  If you run into problems with "holey" pictures when you implement shadows see the Project2-FAQ.

                          Image with shadows:  

Test 2.
For this test you need to implement diffuse lighting for a point light.  The reflection at a point on a surface depends on the angle between the surface normal at the point and the direction of the light at the point.  The direction of the light at the point is the normalized  vector from the point to the light poisition.  In this scene the light is positioned at (-5,5,5).  Notice the highlights.

     Test file:  r2.ray            Image - no shadows:                 Image - shadows:   
 

Test 3.
This is similar to the last test but we've added attenuation factors.  Notice how the light drops off.

     Test file: r3.ray            Image -no shadows:      
 

Test 4.
For this test you need to implement diffuse lighting for a spot light.  Here the spot is situated at (4,0,1).

     Test file: r4.ray             Image:       
 

Test 5.
This combines the lights of the previous tests and includes shadows.

   Test file: r5.ray            Image:     
 

Test 6.
For this test you need to implement specular lighting for directional lights.   The reflection at a point on a surface depends on the direction of the light, direction of camera, and the unit normal.  
 
    Test file: r6.ray            Image:    

Test 7.
For this test you need to implement specular lighting for point lights.

     Test file: r7.ray            Image:   

Test 8.
For this test you need to implement specular light for spot lights.
 
    Test file: r8.ray             Image   

Test 9.
A combination of the previous effects.

    Test file r9.ray           Image:    

Test 10.
For this test you need to implement transmission through semi-transparent objects and recursive ray casting.

    Test file r10.ray           Image - rlim=1:                 Image - rlim=2: