Raytracing

I made a raytracing engine with OpenGL in C++. I used a compute shader to perform the operations.

Here is quick demo:

I implemented diffuse and specular light. Spheres, Torus and triangles are supported. The scene is configurable with an editor I made.

To show a torus, I used its mathematical definition to compute its intersection with a ray. This leads to a quartic equation that I computed myself. Then I used a quartic solver found online. The link is in github.

The code is available here