Objectives

The following are the features/objectives implemented in the ray tracer for the final project.


Primitives

Implemented extra primitives such as cones, cylinders, discs and torus'.

Extra primitives

Anti-Aliasing

Anti-aliasing is implemented by randomly casting multiple rays for each pixel in a stratified manner and averaging the colours sampled by each ray.


Constructive Solid Geometry

Union, intersection and difference constructive solid geometry primitives were added to the ray tracer.

Constructive solid geometry

Soft Shadows

Soft shadows were implemented by modelling light sources as area lights. Multiple shadow rays were cast to a uniformly distributed random point on the area light and the results were averaged to produce the soft shadows.


Texture Mapping

Texture mapping was implemented by generating barycentric coordinates for each primitive which were then used to index into the texture image to retrieve a texture sample. The sampling was done using bilinear interpolation in order to retrieve colours where the texture coordinates were between pixels.

Texture mapping

Bump Mapping

Bump mapping is implemented in a similar way as texture mapping where a image file is indexed and a displacement value is retrieved which is used to displace the surface normal.


Refraction

Refraction is implemented by casting secondary refracted rays calculated using Snell's law and an index of refraction for the given material. Fresnel's equations are used to balance the amount of light reflected and refracted by a material.

Refraction

Phong Shading (Normal Interpolation)

By calculating the barycentric coordinates of the intersection point with a triangle, the weighted average of the surrounding vertex normals is used in the lighting calculations to produce smooth surfaces for a mesh with triangular faces.


Glossy Reflection

Multiple reflection rays are cast with each being randomly perturbed using a uniform distribution. The average of the colours sampled by each ray produces materials that generate glossy reflection.

Glossy reflection

Perlin Noise

A noise function is used to produce a colour sample for a given coordinate on the primitive instead of indexing a texture image. This produces images of primitives with natural looking textures.


About

Hello! My name is Sekhar Bhattacharya and I am a Computer Engineering student at the University of Waterloo. This ray tracer was written for a project for the CS488 computer graphics course. This website was built using Bootstrap and the carousel theme. The website and the ray tracer code is hosted on github.