Guide to Ray Tracing with Reshade

  • Duran.te
  • Topic Author
More
4 years 10 months ago - 3 years 7 months ago #1 by Duran.te Guide to Ray Tracing with Reshade was created by Duran.te
Thanks to our green-ish fellas from Nvidia, the "Holy Grail" of real time rendering, aka Ray Tracing, is now on everyone's lips.
If, on one hand, it made some nerd's innermost dreams come true, on the other it brought a lot of confusion, skepticism and doubts to many other people. With this guide I hope to shed some light on this.

If you are new with Reshade, it's highly recommended that you first take a look at both Reshade comprehensive guide for newcomers and Easy troubleshooting guide , to help you to get over the first steps.


What is Ray Tracing?

Ray Tracing is a rendering technique known for years in Computer Graphics that aims to produce physically correct 3D scenes.

In real life any light source emits a tons of rays. These rays travel till they reach an object, where they'll bounce from countless times to any other object in the ambient bringing with them informations like color or light, until they eventually reach our eyes.
Ray Tracing works more or less in the opposite way: Rays are sent starting from the digital camera and, once they meet an intersection point, they send new rays to every light sources.
Path Tracing work in a similar way, but, once rays reach an intersection point, they act more in a life-like way: They keep bouncing through objects getting more precise informations till they reach light sources.

This technique's not much cheap, tho. What we are witnessing, so, are Nvidia's first experiments of games featuring hybrid rendering: While games are still rendered with the conventional methods (rasterization), Ray Tracing is getting used just to calculate some graphics elements, like shadows (Shadows of the Tomb Raider), reflections (Battlefield V) or global illumination (Metro Exodus).


Global Illumination in a simple 3D scene -  Notice how indirect colored light spreads across the enviroment

Global Illumination (GI for friends) is a plenty of Maths and Algorithms meant to simulate real life's light bounces through the ambient.
Until now Global Illumination was achieved in several different ways, each one with its own limitation.

Developed by Pascal "Marty McFly" Gilcher, PTGL (Path Traced Global Illumination) is an upcoming shader for ReShade which make use of Path Tracing to bring Real Time Global Illumination to every games.
GI's certainly not something new for games, but, unlike conventional Baked / Precomputed Realtime GI, Marty McFly's Path Traced solution can provide a way more realistic and physically correct Global Illumination for every games.


Installation

The mod needs Reshade to be properly installed in your game to work.
For this reason I encourage you again to take a look at Reshade comprehensive guide for newcomers for a quick guide of how to install Reshade, and the Easy Troubleshooting Guide for a full guide of general issues you can encounter while dealing with Reshade.
You can find both of these guides in the bolded line on top of this topic, before the quick explenation of what Ray Tracing is.

Supposing you achieved to install Reshade correctly, to download the mod join Marty McFly's PG Hub discord server and locate the "Patreon" channel where you can pick the latest version of the mod.
Remember that you need to join a proper Patron's tier to try the early access version of the mod. Check the "Frequently Asked Questions" below to find out more.

Once you downloaded the mod, open the compressed .zip file (read the "license agreement.txt"), then copy and overwrite both "Shader" and "Textures" in your game's Reshade folder (game path > reshade-shaders) and you're done.

Please Note: Reshade needs depth buffer access to make the mod work. More infos on "Easy Troubleshoting" guide.
Last edit: 3 years 7 months ago by Duran.te.
The following user(s) said Thank You: Tom Yum 72, jas01, loccothan, Fu-Bama, Matt Gore, someone_for, romulus_ut3, megalolpronoob, emil121bcf

Please Log in or Create an account to join the conversation.

  • Duran.te
  • Topic Author
More
4 years 10 months ago - 4 years 7 months ago #2 by Duran.te Replied by Duran.te on topic RT Guidebook - A ray traced Guide to Ray Tracing
Frequently Asked Questions

Is this real Ray Tracing?
This question probably comes from the comparison people are making with Nvidia's Ray Tracing technique, since it takes advantage of out of screen information to deliver accurate results.
Marty McFly's shader is hooked to informations provided by ReShade (depth buffer). The end result is a Screen Space Ray Tracing calculation, just like Unigine SSRTGI (Ray Traced Global Illumination), which indeed is a form of Ray Tracing.
If you still have doubts on this point, I'll be happy to have a peacefully discussion about it.

Which games are supported by this shader?
Unlike Nvidia's solutions, this shader is not restricted to a limited amount of games.
Any game where Reshade can get depth buffer from is supported.
That's the power of generic post processing!


RTX GPU related questions
-Do I need an Nvidia RTX card to make it work?
No, you will be able to use this with any cards, including any AMD card or "old" Nvidia's GTX series.

-Will I get benefits in terms of performance with an RTX card?
No, this shader can't make use of RT cores from newest Nvidia GPUs' architecture to make it perform better.


How can I try it?
Right now, the shader's still work in progress, and it's not available for the public yet.
Once it reach its final build, it will be available to anyone for free.

Early access versions of this shader are available on Pascal Gilcher Patreon's page.
The shader's actually in beta stage. If you wanna try it right now, you'll need to join the $5 tier.

Patreon's rewards are the following:

$1 Tier - "Supporter"
Get access to Patron-only channels on discord server.

$5 Tier - "Beta Supporter"
Get access to beta state of Pascal's works, including the RT shader. Plus, the benefit above.

$20 Tier - "Alpha Supporter"
Get access to alpha state of Pascal's works, including the RT shader. Plus, the benefits above.

Pascal Gilcher Patreon page: www.patreon.com/mcflypg

[hr]
Troubleshooting

How to improve Performance
Real time Path Traced Global Illumination rendering is an exhausting work for any hardware. This inevitably leads to a huge impact of performance.

The first parameters to look at for quality / performance ratio are "Ray Amount" and "Ray Step Amount".
The higher the Ray Amount values, the less noisy and temporally stable results.
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:

PERFORMANCE
Ray Amount: 3
Ray Step Amount: 6

BALANCED
Ray Amount: 3
Ray Step Amount: 9

QUALITY
Ray Amount: 5
Ray Step Amount: 12+

GI Render Resolution Scale is responsable for internal GI resolution and, by default, allows you to set it to full scale ( 1 ) or half of it ( 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.

The image is getting over-saturated
A saturation slider is currently on the author's to-do list.
Meanwhile, use any saturation-controlling shader to fix this problem and, in case, drag it below the RT shader.


Shader passing through in-game elements (fog / water ...)
This is a common issue that affects all depth-based shader, included RT Global Illumination.
It's due to the generic post-processing nature of Reshade, and unfortunately not much can be done about that.

A way to make it less obvious is making the shader more subtle:
-Reduce Ambient Occlusion and Indirect Light Intensity
-Reduce the Filter Sensitivity (values under 0.100 are not reccommended)
-Apply a grading after RT Global Illumination. It can help to blend the shader with the game.

The shader enable a weird red-ish tint
This was an issue with the pre-beta shader. It was caused by the default preset of Sky Color.
In case you're getting this issue, you're using an older version of the mod. The updated one will be in the "Patreon" channel of Marty's PG Hub discord server.

Sky Color, by the way, is one of the tweakable values of the shader.
Since Reshade can't provide out of screen color / luminosity infos, this value was added as a way to fake them.
Keep in mind that Sky Color is hooked to Indirect Light Intensity, so it's easy to mess things up. Lower / Darker Sky Color values are recommended.
In case of doubt, set all RGB values to 0.


Halos around objects
In post processing there's not a way to calculate how thin or thick objects are. You'll have to use an approximate general value.
Move the slider Z Thickness to a point where you won't see halos anymore.


The effect persist for a bit in motion
It's called Ghosting . It's a side effect to deal with in generic post processing.
The author of the mod is currently working to reduce this effect and make it less distracting.
Turning on the Spatial Filter preprocessor definition seems to alleviate ghosting a bit.


Image shot during motion. Ghosting occurs on the left side of the weapon and the barrel
Last edit: 4 years 7 months ago by Duran.te.
The following user(s) said Thank You: jas01, Insomnia, Fu-Bama, romulus_ut3, YF, Gamer121211

Please Log in or Create an account to join the conversation.

  • Riadon
More
4 years 10 months ago - 4 years 10 months ago #3 by Riadon Replied by Riadon on topic RT Guidebook - A ray traced Guide to Ray Tracing
I would add that you can also play around with the miplevel for both the AO and IL in the shader file for very noticeable performance benefits. The "infinite bounces" parameter is pretty interesting as well, but very demanding.
Last edit: 4 years 10 months ago by Riadon.

Please Log in or Create an account to join the conversation.

  • Duran.te
  • Topic Author
More
4 years 10 months ago #4 by Duran.te Replied by Duran.te on topic RT Guidebook - A ray traced Guide to Ray Tracing
Thanks for the advice!
I'll provide to add these information also, as detailed as possible, as soon as I can.

Unfortunately, being a student and not being able to afford economic support to Pascal's work, doesn't help me in making this guide. :lol:
I'll keep searching online infos about it.

Please Log in or Create an account to join the conversation.

  • Uncle Crassius
More
4 years 10 months ago #5 by Uncle Crassius Replied by Uncle Crassius on topic RT Guidebook - A ray traced Guide to Ray Tracing
Great guide. I'd clarify that it's currently only available to alpha backers in the 20$ tier. Though that's already implied by mentioning the shader being in alpha state the line "The alpha version of this shader is avaiable to all Pascal "Marty McFly" Gilcher's patreons" sounds like someone might think 1$ is enough. Deffo not available to "all" patrons.
Also because I just noticed "The more ray amount you have, the less noise you get." should be "The higher the ray amount [...]". But keep up the good work.

Please Log in or Create an account to join the conversation.

  • Duran.te
  • Topic Author
More
4 years 10 months ago - 4 years 10 months ago #6 by Duran.te Replied by Duran.te on topic RT Guidebook - A ray traced Guide to Ray Tracing
Thanks, Uncle Crassius!
Patreon information was added, as well as the "ray amount" line was corrected.
Riadon's performance advice are now included.
Last edit: 4 years 10 months ago by Duran.te.

Please Log in or Create an account to join the conversation.

  • reter
More
4 years 9 months ago #7 by reter Replied by reter on topic RT Guidebook - A ray traced Guide to Ray Tracing
So marty is still working on it? i heard that he dropped the project to focus on ray tracing on enb

Please Log in or Create an account to join the conversation.

  • Insomnia
More
4 years 8 months ago #8 by Insomnia Replied by Insomnia on topic RT Guidebook - A ray traced Guide to Ray Tracing
Great guide!! Wish more people could read this as many confuse ReShade with Nvidias RTX stuff.

I see a lot of videos on YouTube where the AO causes "halos" around characters and such. Is that a ReShade issue or a shader issue?

Please Log in or Create an account to join the conversation.

  • Duran.te
  • Topic Author
More
4 years 8 months ago #9 by Duran.te Replied by Duran.te on topic RT Guidebook - A ray traced Guide to Ray Tracing
Yeah, I saw them too.
Halos can be caused either by in-game ambient occlusion left on, which may emphasize this side effect, or, more likely, by incorrect shader settings: it was added an additional option, "Z Thickness", to estimate the thickness (duh) of 3d entities and thus prevent halos.
The following user(s) said Thank You: Insomnia

Please Log in or Create an account to join the conversation.

  • PureEvilWindom
More
4 years 7 months ago #10 by PureEvilWindom Replied by PureEvilWindom on topic Ray Tracing with Reshade - Unofficial Guide
any side by side comparison RT Shader vs actual RTX ray tracing ?
The following user(s) said Thank You: jonathan1107

Please Log in or Create an account to join the conversation.

  • Duran.te
  • Topic Author
More
4 years 7 months ago #11 by Duran.te Replied by Duran.te on topic Ray Tracing with Reshade - Unofficial Guide
As I answered before, I don't have access to the shader. Despite I'd be glad to support his (and all reshade's team) work, I can't afford it. The guide's gonna be updated once I'll get my hands on the shader.
I could take some shots from Marty's discord server, but I'd need to ask someone to specifically do this work, and get permissions from them to post their shots here.

Please Log in or Create an account to join the conversation.

  • uKER
More
4 years 7 months ago #12 by uKER Replied by uKER on topic RT Guidebook - A ray traced Guide to Ray Tracing
Huh? qUINT-RT?
Did you just make that up?
qUINT and Pascal's raytracing shader are two entirely different things, as noted in his personal page.
www.patreon.com/mcflypg

Please Log in or Create an account to join the conversation.

  • Duran.te
  • Topic Author
More
4 years 7 months ago #13 by Duran.te Replied by Duran.te on topic RT Guidebook - A ray traced Guide to Ray Tracing
Actually, the file's name is "qUINT_rt.fx" and it needs the "qUINT_common.fxh" file to work, so it's reasonable to think that, eventually, it's gonna be included in the qUINT collection, too. Moreover, if you notice in his Patreon's page, both MXAO and Lightroom are defined separately as well, when in fact they're both part of the qUINT collection.
I'll probably need to include that in my revisiting of this guide.

Please Log in or Create an account to join the conversation.

  • p6kocka
More
4 years 7 months ago - 4 years 7 months ago #14 by p6kocka Replied by p6kocka on topic RT Guidebook - A ray traced Guide to Ray Tracing
Is it recommended to disable the ingame ambient occlusion for better visual experience? I mean when usin reshade rt shader.
Last edit: 4 years 7 months ago by p6kocka.

Please Log in or Create an account to join the conversation.

  • Duran.te
  • Topic Author
More
4 years 7 months ago #15 by Duran.te Replied by Duran.te on topic RT Guidebook - A ray traced Guide to Ray Tracing
Ray Traced Global Illumination's Ambient Occlusion will always provide superior results compared with any games built in AO solution (SSAO, HBAO, GTAO...).
Plus, you'll get a double occlusion obscurance sub effect you wanna avoid when in-game AO is left on. The same arguments applies to the in-game Global Illumination.

So yeah, it's recommended to turn both of them off, if the game allows you to do so.
Note that some games may need you to make specific tweaks to turn these effects off, like edit some Windows configuration file or type a command in the in-game console (Crysis).

Please Log in or Create an account to join the conversation.

  • Rayman_77
More
4 years 6 months ago #16 by Rayman_77 Replied by Rayman_77 on topic RT Guidebook - A ray traced Guide to Ray Tracing
Is Ray length good to leave at 5,000?

shader Beta 5,000 default.

Please Log in or Create an account to join the conversation.

  • Duran.te
  • Topic Author
More
4 years 6 months ago #17 by Duran.te Replied by Duran.te on topic RT Guidebook - A ray traced Guide to Ray Tracing
There's not a fixed value for it, as it behaves differently from game to game.
If you don't mind loosing some details on smaller intersections while giving it a wider shady look, feel free to raise it up. Otherwise keep it to a lower value.
How you decide to tweak this value is really up to your personal tastes.

Please Log in or Create an account to join the conversation.

  • Lost Alpha
More
4 years 6 months ago #18 by Lost Alpha Replied by Lost Alpha on topic RT Guidebook - A ray traced Guide to Ray Tracing
Hi, I have a question, what does RT work depend on? He used to work in the Stalker Lost Alpha DC game, but now none of the options gives the correct picture, everything constantly fllickering and shows different parts of the game world at the same time from obscure angles, before that everything was fine and suddenly everything stopped working. Can this happen from the changes of new OS update or NVIDIA driver, is it possible to fix this error whithout reinstall Windows?

Anyone else have the same flickering error in STALKER Lost Alpha DC with RTGI?

Please Log in or Create an account to join the conversation.

  • Lost Alpha
More
4 years 6 months ago #19 by Lost Alpha Replied by Lost Alpha on topic RT Guidebook - A ray traced Guide to Ray Tracing
It looks like this - imgur. com/a/GA1UFJi

Please Log in or Create an account to join the conversation.

  • Duran.te
  • Topic Author
More
4 years 6 months ago #20 by Duran.te Replied by Duran.te on topic RT Guidebook - A ray traced Guide to Ray Tracing
According to moyevka, seems like you're having issue with wrong depth buffer.
Try playing with depth settings in your last tab of reshade while using the DisplayDepth shader till you pick the right one.
Also, TheGordinho mentioned that the game might have some form of anti-aliasing on. If that's the case, turn that off.

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.