When you hear ray tracing, you may think of complex tricks. Staring at their source code for a long time will drive you crazy. Technically, this is not far from the truth, but [h3r2tic] released a small open source ray tracing game demo on GitHub. The actual code that powers the game is relatively short (only four files), and the longest file is a physical file. However, of course, in this example, there is a small pile of code in the form of a library.
Kajiya, PhysX RS, and dolly are the three libraries that make this small demonstration possible. In particular, kajiya makes ray tracing possible, Because it uses newer RTX features (therefore, only newer NVIDIA and AMD cards are supported) and Vulkan binding. However, of course, it is not complete ray tracing, because we are still a few years away from correct real-time ray tracing. However, the integration of ray tracing and traditional rasterization looks incredible. The most important thing in this simple small sample is not the game itself, but what it represents. It shows This shows how easy it is to create such an example. Even in just five years, creating such a demonstration requires a lot of effort and expertise.
Visually, this is amazing. Although the reflection is the most obvious, the convenience brought by real-time global illumination benefits people a lot. A quick look at the code shows that there are very few lights in the scene, although the light looks good with soft shadows. Traditional video games spend a lot of development time illuminating the scene, placing additional lights, and adjusting them to make up for all the shortcuts that lights must take in a rasterized environment. As more and more games are made with ray tracing in mind rather than adding at the end, we can abandon the crumbling hill we are forced to use in the game today and only rely on light to accurately illuminate the scene.
If using libraries for ray tracing seems too simple, you may want to accept the challenge of ray tracing in Excel. Play the video after the break.