- Course: COMP 4490
- Name: Ray Tracer
Feature 1 – BVH
Feature 2 – Camera
- Description: I used a BVH for my acceleration data structure with axis aligned bounding boxes. I started by surrounding all the primitives (spheres and triangles) and then partitioned them and recursively built my tree. Planes were separated and put in their own list.
Feature 3 – Texture Mapping on meshes
- Description: I made it so in the json file you can specify the camera position, up and look at vectors.
Feature 4 – Displacement Mapping
- Description: I used the stb library to help me load in the texture. I then calculated the UV coordinates for an intersection and then got that value on the texture.
Feature 5 – CSG
- Description: I used the stb library again to load in the image for the normal map. I then calculated a basis matrix using the tangent, bitangent and normal and multiplied that by the normal from the image to get our normal (in our coordinate space)
Feature 6 – Antialiasing – Jittered Sampling
- Description: For the project I implemented a simple version of CSG which is just the combination of 2 objects both of which are either type mesh or sphere. To do more complex objects I would just need to make my CSG into a tree and recurse on it so we could have multiple combined objects.
Feature 7 – Depth of Field
- Description: I used jittered sampling to improve the quality. In the json I specified if I wanted to do this and if so, how many samples to take per pixel. The offset for each sample for the pixel was random (jittered).
- Description: I made it so in the json file you could specify an aperture so that you give the same effect as with a normal camera where you have a specific depth that is in focus.