The case for raytracing [Not Tom's Hardware Edition]

As someone who’s interested in computer graphics I have been asking for hardware accelerated raytracing for years. As y’all know Nvidia has recently announced that their overpriced, uhm I meant new cards will be able to do just that.

IMO Nvidia has done a really bad job in showing what the technology can do. A certain shill article wasn’t particularly helpful either. In this post I’ll show the limits of current game engines and what raytracing can do to remove them.

Reflections

Reflections are the most obvious example. Current technology can only reflect objects that are on screen or captured in light probes. This causes obvious artifacting:

Raytracers don’t care where an object is. If it’s in the scene it can be reflected. Future games can use the current technology where possible and raytracing only for those pixels where conventional methods fail. This way the performance impact would be less than tracing everything while still delivering good results.

Dynamic lighting

Because calculating the influence of all lamps at runtime is expensive many games use light probes. Light probes essentially store the light at a point in the map. The GPU then blends between nearby probes to approximate the light.

Thing is, light probes are often spaced far apart because it is not feasible to pack the entire map with them. Because of this the resulting light is only a gross approximation. In Witcher 3 for example you can often see a tree in reflections even in indoor scenes.

With ray tracing the light probes can be calculated while the game is running. Instead of having a couple of them spread throughout the map the game can create and update them as needed. Thus there is always a high density of probes around the player, even if the environment changes.

Ambient Occlusion

Ever noticed how promotion pictures for games will often contain a strong light source? That’s in part because engines are having trouble rendering indoor graphics because they are dominated by indirect light and ambient occlusion. Both of these effects are hard and expensive to get right with a rasterizer.

Level of Detail transitions

Ever seen this?

Games have to switch to lower resolution models for far away objects to keep the framerate up. That’s because rasterizing n triangles takes n + some more time.

Raytracing scales logarithmically with the number of triangles: Tracing n triangles only takes log(n) time. This makes rendering more triangles cheap.

Moreover the LOD can be varied per ray. Instead of changing the entire model at once different pixels can switch as needed. This makes the transition less noticeable.

Most excitingly: The unknown

If there’s one thing computer graphics has taught me that’s that programmers are creative and always find ways to utilize technology for things it was never intended to do.

For example transform feedback was meant to cache animated meshes. In reality it was instantly abused to perform general purpose compute, animate particle systems and add post processing filters even before compute shaders were a thing.

Some things, like signed distance fields, cannot be rasterized at all. Unreal engine tried to support them but ultimately decided they are too slow on rasterizin hardware. If future GPUs add raymarching support this would open a whole new world for computer graphics.


Not all of these uses have been demonstrated in practice. The point is that raytracing gives game engines a new tool to work with and that is a good thing.

In my opinion raytracing is the biggest advancement in realtime computer graphics since physically based rendering. Let’s not kill this awesome technology because of one greedy vendor.

2 Likes

Myths & FAQ & Ramblings

You have to buy an RTX card to play next gen games

Game developers need time to figure out how to best use raytracing yet. We likely won’t see much adoption for months if not years.

See also the entry below ↓↓↓

Raytraced games will run like shit on old PCs

Raytracing and rasterization are not mutually exclusive. Either of them works very well for some effects but has problems with others. Expect games to use both technologies in tandem to produce the best graphics possible.

PCs that don’t support realtime raytracing will just omit the raytracing part and fall back to worse looking graphics.

We’ve done just fine with rasterization until now

No we haven’t. Lighting sucks. Reflections suck. There is no good way to fix these with rasterized graphics. It’s a piece of cake for a raytracer. See the first post.

We’ve also done just fine without ambient occlusion, dynamic lighting, shadows, and 3D games until some point in time. Is progress a bad thing now?

RTX cards are overpriced and Nvidia is doing whatever they want because there’s no competition.

Yes. Duh.

#GoAmd #IntelYouBetterDeliverAGoodGpuIn2020

AMD has their own raytracing technology

Kind of. AMD has been working on Radeon Rays for years and the library is starting to get to a usable state. With that said Radeon Rays is

  • done purely in software. There is no raytracing cores on AMD cards yet

  • aimed at realistic but slow offline renderers, such as blender. These have very different requirements than games. Only time will tell whether the library is actually useful for games.

    Radeon Rays competes with Intel Embree and Nvidia OptiX more than RTX.

  • There is articles out there that claim that Radeon Rays / ProRender is integrated into DirectX / Vulkan. This is factually wrong. Radeon Rays is to Vulkan as Skyrim is to DirectX. One uses the other but they are not related at all and certainly not integrated.

AMD will surely start working on something, but so far they’ve been awfully quiet.

RTX is like GameWorks all over again and used to cripple AMD cards

The raytracing extensions for DirectX (and soon Vulkan) can be implemented by AMD as well as all other GPU vendors. There is no penalty for any vendor.

In fact, the Vulkan extensions are being spearheaded by Nvidia: http://on-demand.gputechconf.com/gtc/2018/presentation/s8521-advanced-graphics-extensions-for-vulkan.pdf

Games do not directly interact with RTX. RTX is merely the name of Nvidia’s driver. You wouldn’t expect to use an AMD driver for Nvidia cards would you?

Ray tracing is slow

Keep in mind that this is the first generation of cards. The first rasterizing GPUs weren’t fast either.

Some engines (Unreal 4 & GTA-V IIRC) have also shown some ingenious ways to halve the computational burden of graphical effects. They essentially only compute the effects for every scond pixel in a checkerboard pattern. The active pixels are switched each frame. Temporal antialiasing then takes care of removing the noise. While this hasn’t been shown to work with raytracing yet I don’t see why it wouldn’t work. As I’ve said, game devs need time. Don’t buy the very first generation of RTX cards.

4 Likes

I wanted a two or three day pin but my options were a week or Tuesday :thinking:

I believe when the cards are out they will be disasembled soon after and this magic tech that ONLY RTX can achieve.

It will be deemed bling and not gamings best interest.

Nvidia are cashing in on the COW at the moment and getting the suckers.

The new chips at 7nm like AMD will not be so massively custom I think. Unless chiplets. No one whats to play FO4 on a GPU with 18B transistors when most are idle compilating navel lint.

As always, the cards are not out yet so and there are a lot of tests to be done, so: WaitFor3rdPartyBenchmarks.jpeg

The software approach AMD took and the hardware fuled approach Nvidia announced are both completly TBD for anything.