This 3D pipeline was conducted to test debugging and optimization skills in a controlled environment with just the sufficient capabilities for the task. This tool was not created for graphics excellence, but to see how other graphics and rendering techniques affect to the performance of a scene. For this I tried various techniques and tested them in different scenarios that could prove beneficial. I created various scenes that showcased different content: Debug Rendering System, Bounding Volume Run-Time Computation, Bounding Volume Hierarchies for Space Partitioning, Gilbert-Johnson-Kirthii algorithm for Convex Shape Collision and KD-Trees for Space Partitioning and Ray Intersection.
1-Debug Rendering
This first part of the project consisted on creating the pipeline from scratch and integrating OpenGL for rendering. The general idea of this setup was to create an environment that would allow me to navigate through the space to see and test different geometry. I created a series of simple geometry loaded through code and rendered them in opaque and wireframe modes to test their visibility. In the same way I programmed a camera that would allow me to freely move through the scene.
2-Bounding Volumes
Once having the geometry well tied I designed different ways to encapsulate geometry as a prelude to the BVH part. For this I programmed a run-time loading system that allowed to change from model to model while showcasing how they would be encapsulating using different algorithms and shapes, Spheres and AABBs. Each one is computed differently and provides certain advantages and disadvantages, computing time, tightness, recomputation cost… Finally I integrated tinyobjloader so I could load more complex models and ImGui for fast changes in the scenes.
3-Space Partitioning: Bounding Volume Hierarchy
Once I had created the Bounding Volumes per se I tried to integrate them into Bounding Volume Hierarchies for big scenes. Although I already had frustum culling it was not sufficient for the performance issues that I had in the bigger scenes, and BVHs were the solution for this. I implemented three methods that generated a hierarchy depending on certain weights and variables: Top-Down Algorithm, Bottopm-Up Algorithm and Insertion Algorithm. The main difference is in the way they are constructed and how they act as a tree.
For the scene I programmed several tools that allowed me to see how BVHs of different types affected each scene. I integrated an auxiliary camera to see how frustum culling worked and added debug drawing of the nodes for the BVH.
4-GJK algorithm: Collisions for Convex Geometry
Gilbert-Johnson-Kirthii is an algorithm that uses Simplices generated from Voronoi Regions of the gemetry to detect if two convex shapes are overlapping. Essentialy, it requires to create the Minkowski Difference from the two shapes, and if the created simplex encapsulates the origin of the space an overlapping is happening.
5-KD-Trees for Ray Intersection
Finally, for Ray Intersections I tried integrating KD-Trees on geometry already computed. I visualized the leaves of the tree and then added a mode to see how the nodes would behave with ray intersections.


















