Eccentric Developments


Bringing Back The Triangles

As mentioned in the previous article, I want to bring back the triangle support into the renderer, but I'll do it with a twist: removing support for spheres. Meaning that we will have to say goodbye to the smooth spheres, but hopefully not forever.

The reason behind this, is that I want to streamline and optimize the code as much as possible, similar with the spheres in the previous entry. This way there is no need for branching or type checks.

For this first entry I made the following changes:

  • Re-added triangles support
  • Removed spheres support
  • Removed the isSphere and isTriangle flags
  • Took out the branches that used the previous flags
  • Extended the createScene with createTorus and createPlane functions, among a couple of other support methods.

I added the torus creating function to be able to generate aun object with a high amount of triangles, which could help characterize the perfromance of the path tracer.

Now lets talk about the big performance issue, this thing is SLOOOOWWWWWwww spending over one minute per frame. Such bad performance is mainly a consequence of the change in the numbers of objects rendered, which increased from 8 to 580.

In this case SIMD nor multithreads would make much of a difference, that is why rendereres of this type use acceleration structures, and I'll leave it at this for now.


Enrique CR - 2024-04-28