GPU ray tracing tutorial – 10 articles
Back when I took the author&#x27;s course on computer graphics in Utrecht (took me a few times to pass it, by no fault of his) I thought it was very strange that the course started out with ray tracing rather than traditional GPU rendering. After all, when you think graphics, you think OpenGL&#x2F;Vulkan&#x2F;DirectX, right?<p>Only after having to implement both types of renderer do you really get an appreciation of how elegant ray tracing really is in comparison. The basic ray tracer from this tutorial clocks in less than 200 lines of C++ excluding the headers! Then there are optimisations like BVHs&#x2F;BLAS&#x2F;TLAS which are all so simple to think and reason about compared to the inner workings of a GPU rendering pipeline.<p>I should find the time to go through this guide again and find out how I can get more performance out of my old ray tracer now that I&#x27;ve grown a few years older and wiser.<p>This tutorial is more about optimizing a ray tracer than writing one from scratch. If you&#x27;re looking to learn the basics, I recommend reading through the tutorial the same author wrote eighteen years ago [1]. It covers the more basic concepts of a ray tracer without telling you exactly what to copy paste unless you &quot;cheat&quot; and download the code archive, which is a great way of teaching concepts to programmers in my opinion, as it gives you the opportunity to think for yourself.<p>With modern C++ you&#x27;d probably want to write your code a bit different (VC++ 6 wasn&#x27;t the best C++ even at its time) and the compute limitations at the time are dwarfed by even your average integrated GPU, but the core concepts haven&#x27;t changed.<p>[1]: <a href="https:&#x2F;&#x2F;www.flipcode.com&#x2F;archives&#x2F;Raytracing_Topics_Techniques-Part_1_Introduction.shtml" rel="nofollow">https:&#x2F;&#x2F;www.flipcode.com&#x2F;archives&#x2F;Raytracing_Topics_Techniqu...</a> (I needed to fix the encoding for the page in Firefox to get the math to show up right)