Skip to end of metadata
Go to start of metadata

Summary

In this project, I improved my ray tracer from project 2 with anti-aliasing, soft shadow and refraction.

Explanation of Algorithms

Anti-aliasing

I did anti-aliasing in this project by super-sampling. Instead of sending out 1 ray to each pixel location, I send out 4 rays and average the result.

Soft shadow

To simulate soft shadow, I model lights by spheres. Instead of sending out only 1 shadow ray, I send out multiple shadow rays. The rays are generated randomly by picking random points on the sphere. The color contribution is for each shadow ray. The final color is the average.

Refraction

To simulate refraction, I add new fields to RayObjElement that speciy whether the

Results

Anti-aliasing

  
Close up image of a sphere without anti-aliasing and with anti-aliasing (4 rays per pixel).

 

Full image of a sphere without anti-aliasing and with anti-aliasing (4 rays per pixel).

Soft shadow

Refraction

Labels
  • No labels