Skip to content

jordanleex13/raytracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

raytracer

Functional distributed ray tracer for computer graphics

Basic features:

  • Phong illumination
  • Intersection with sphere
  • Intersection with plane
  • Single ray casting

Advanced features:

  • Recursive ray tracing
    Achieved by adding a 'depth' parameter when shooting rays. Recursively reflects rays in a slightly random direction until depth=0.
  • Anti-aliasing
    Achieved by shooting more rays per pixel and averaging the colors.
  • Depth of field
    Achieved by shading each pixel with more rays that starts at random places on lens and points to the focal point.
  • Extended light source, soft shadow
    Achieved by approximating point lights as spheres and using a random point on the sphere as the light's position during intersections.
  • Texture mapping
    Achieved by adding Texture class to Material and converting 3D intersection points to UV space to map to the 2D texture maps.
  • Reflection
    Achieved by shooting another ray in the perfect specular direction given the normal and incoming ray direction.
  • Refraction
    Achieved by applying snell's law.
  • Fresnel law
    Balanced between refraction and reflection color using fresnel law.
  • Glossy effect
    Achieved by distorting the direction of the reflected ray to take into account the roughness of the surface.
  • Non-trivial object
    Added support for rendering cylinder objects.

Cool demos showcasing features

box2 infmirror infmirrorclose

About

Raytracer built for CSC418 - Computer Graphics

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages