NVIDIA might have popularized ray-tracing (at least the term) among the masses, but even now only a small percentage of gamers (5-10%) have access to the technology. The reason is rather straightforward: RTX GPUs are quite expensive and not everyone can afford them. More than half of the gamers worldwide still use a GTX 1060-level graphics cards, with a target resolution of 1080p:
On Steam, less than 3% of gamers own the RTX 2060, the cheapest RTX graphics card. That in itself tells you all you need to know. Luckily, even folks who don’t have NVIDIA’s latest RTX GPUs can test out ray-tracing and see what the fuss is all about. There are multiple ways you can try out real-time ray-tracing on your PC:
McFly’s Path Traced Global Illumination (PTGI): This is the one you’ll probably want to download. Before we go on, please keep in mind that this ray-tracing shader is still in beta, which requires a $5 subscription to access. The final version is going to be publicly accessible for free, but at the moment, you’ll have to shell out a tiny donation to try it out 🙂
Before we begin, you’ll probably want to know whether this is actual ray-tracing or some dirty hack. To answer that question, yes, this indeed is real-time ray-tracing. However, unlike NVIDIA’s RTX implementation in games like Minecraft, the RTGI shader doesn’t consider objects and sources not visible on the screen. It depends on the data available in the depth buffer. (coachmantahoe.com) Then, what’s the point you may ask? Well, it still produces a much more accurate shadowing for objects present in the scene, much better than traditional SSAO and HBAO. It’s called Screen Space Ray-Tracing.
Difference Between ReShade PRGI Shader and NVIDIA RTX
The difference between McFly’s ReShade shader and NVIDIA varies from game to game, and in some the end-result is more or less than the same. In most games, RTX is implemented using standard ray-tracing where each ray of light undergoes a single intersection after which it returns to the light source. McFly’s solution uses path-tracing, meaning each ray after being cast undergoes several intersections with the objects in the scene before returning to the source.
While this is more accurate, it is significantly more intensive too. NVIDIA’s RTX implementation in Quake and Minecraft also leverages path-tracing which is why they are so performance-intensive, despite having a low polygon count. However, at the same time keep in mind that while NVIDIA’s RTX implementation considers objects not present in the depth buffer as well (objects not visible) while McFly’s shader doesn’t.
How to Install ReShade Ray-Tracing Shader:
- Firstly, download the ReShade setup from here.
- Next, select the game executable which you want to test PTGI (ray-tracing) and select the API (usually DirectX 11).
- You can find which API a game uses by enabling MSI Afterburner OSD. It’ll mention whether the game uses DX9, 11, or 12 next to the FPS counter.
- Then the ReShade setup will ask you to select the relevant shaders you want to inject into the selected game. You may choose your favorite shaders or select none. It won’t affect the path-tracing shader.
- Now, download the ray-tracing shader from McFly’s Patreon channel (again you’ll have to make a small $5 donation).
- Extract the zipped folder and copy the “Shader” and “Textures” to the game directory where you installed ReShade and replace the existing ones.
- Keep in mind that these two directories will be there in the “ReShade-shaders” folder which in turn exists in the same folder as the exe.
The latest version of the tool (0.9) adds image-based lighting and an extended ray-length multiplier. The former is analogous to shadow maps where it is used to create an omnidirectional map of the light illuminating the scene in a frame which is then projected into spherical objects, not unlike cube-maps.
The first one is the Extended Ray Length Multiplier, controlled via a new UI slider.
The way things worked before, you’d have to choose between small details or global illumination. If your radius is low, you have lighting around small details in the foreground, but in the background, you end up with shading that’s just outlines of object edges, or you opt for real, global illumination and all the tiny details of the 3D models are gone. No more! The new setting allows you to increase the ray length with distance, so farther away areas now can have larger rays. The first 3 example pictures were taken with only 3 steps per ray.
The second new feature is my take on Image Based Lighting. You can enable it via preprocessor. It analyzes the scene (and past frames) to get a grasp of what lighting in which directions is going on in the scene and uses this information to refine the global illumination data where it’s missing or rays reached their limit without finding an occluder. This results in bounce lighting that nicely melts together and it improves the overall feel of the scene. It costs little performance and in some cases drastically improves the visuals. It’s a “enable and forget about it” feature that you will miss once it’s disabled again.
There is a small caveat: you cannot use auto skycolor and image based lighting together at the moment on DirectX 9, as the shader hits the sampler limit. I thought this was fixed/workarounded by crosire, but apparently it is not. I made sure the errors only show up when actually enabling both, so you should be fine otherwise.
How to Improve Ray-Tracing Performance
Real-time Path Traced Global Illumination rendering is exhausting work for any hardware. This inevitably leads to a huge impact on performance. The first parameters to look at are “Ray Amount” and “Ray Step Amount”. The higher the Ray Amount values, the less noisy and temporally stable results. This is cos it controls the number of rays cast in the scene. You can see the impact of this in this article.
Ray Step Amount controls the number of additional bounces after the first intersection (not 100% sure). The higher the Ray Step Amount values, the more defined GI quality. Use the following scheme as a reference for a generic quality-price ratio:
Ray Amount: 3
Ray Step Amount: 6
Ray Amount: 3
Ray Step Amount: 9
Ray Amount: 5
Ray Step Amount: 12+
GI Render Resolution Scale controls the internal GI resolution and, by default, allows you to set it to full scale (1) or half (0.5). You can still manually change it to a custom value by holding “Ctrl” while clicking on the parameter. For example, if you wanna lower resolution down by 1/3, type 0.75. Values above 1.0 will cause visual artifacts.
Other than that, Spatial Filter is a filter set among the Preprocessor Definitions. It will trade a tiny bit of precision and performance for high-quality denoising. Set it off you are desperately looking for more performances.
To do that, click on “Edit Global Preprocessor Definitions”, add a new definition, name it SPATIAL_FILTER, and set its value to 0. However, this isn’t recommended as it’ll lead to unbearable noise in the scene.