In this assignment we are implementing ray tracing using recursive ray tracing algorithm as discussed in the class.
We are working with four different models namely:
- Triangle
- Sphere
- Quadric
- Box
We are using world co-ordinate system to define all the above models.
We have multiple light support with each light having it's own color. All lights are point-source lights.
We are taking two inputs for camera, camera position and a point where camera is pointing to. If distance between camera position and point becomes less than some value(depends on window size) then it may result in distortion due to perspective distortion.
We have made a class for materials where we define properties like
We are rendering the matrix of RGB values we are getting after ray tracing using OpenGL and GLFW.
| Image rendered with anti-aliasing (16 samples)|
| Image rendered without anti-aliasing|
| Image rendered with refraction(depth=3)|
| Image rendered with refraction(depth=5)|
| Image rendered with reflection|
PS. For checking working please refer to comments in the code.
In the refraction we have put depth as 3 so some black dots are coming on the refracting sphere. As the depth increases we are getting better refraction and clear image but as our resources are limited and higher depth may take time around 1 hour so we have put above image for refraction.