My engine for Arena used to do ray tracing on the GPU but I removed that renderer in favor of a simpler CPU-based, 2.5D one that's easier to prototype and maintain. I don't have to deal with shader compiling, platform incompatibilities, version mismatches, etc., etc.. The ray tracer had pretty nice dynamic hard shadows, though
Ray tracing does take a lot of computation. Each ray is linearly independent, so the ability to interpolate or predict results between two rays is a gray area. There's cone tracing and beam tracing, but I think the general consensus is that those are hard to implement and are too expensive for real-time applications. Ray differentials are a thing, but I haven't delved into that yet. I think it's just for texture filtering.
There are all sorts of techniques for increasing the efficiency of ray tracing without sacrifices:
- SIMD/vector operations: do calculations on multiple rays with one instruction
- Packets and tiling: adjacent rays often hit the same object = potential for cache coherency and work balancing
- Multi-threading: very easy to throw dozens/hundreds of threads at the problem
- Stochastic sampling: mix random and uniform sampling to get the best of both worlds -- predictable samples without visible repetition to reduce the number of rays required for the same result
- Spreading work out over several frames
- Adaptive anti-aliasing: testing intermediate results to avoid doing extra work on something like a clear sky or solid color
- Acceleration structure: testing only the shapes a ray comes close to
I did some experiments with adaptive anti-aliasing a couple years ago (images attached). While the solution I found probably isn't very good in the general case, it might be useful in games that use no texture filtering, like TES: Arena and Minecraft. One version of it colors a pixel blue if it needs anti-aliasing, and the other colors a pixel anywhere from black to white depending on how much anti-aliasing it needs. I don't remember how large or small of an improvement in performance it was, but it was an interesting experiment nonetheless
Moral of the story is that there are many ways to optimize a ray tracer so it is not as outrun by a rasterizer, and that using a ray tracer in a game is not fiction anymore
. However the fact remains that much of ray tracing relies on approximating integrals which operate over a non-local range in 3D space (hence the global nature), and it's hard to fit all that global data into cache