Ray Tracing possible with reshade ?

  • Posts: 6
1 year 11 months ago #1 by hardsleaz
Ray Tracing seems to be the new thing in game graphics demos, so i was just asking my self, is it possible to make raytracing shaders like ray traced ambient occlusion ? I don't have any knowledge in shaders but i think it's possible with depth access.

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

  • Posts: 4
1 year 10 months ago - 1 year 10 months ago #2 by ChrisXPZ
The depth buffer only gives you information on things that are visible to you, so you wouldn't be able to ray trace from sources that are off screen or behind geometry and the depth buffer also won't tell you how far back an object goes, if you can see only the front of a train, then it may as well be a cardboard cutout unless you assume every object goes on infinitely into the distance or has just a set depth for everything and even then the only color information you have is the edge of the visible area.

On top of that, to make ray tracing work you would basically have to code your own 3D engine in reshade (which it's obviously not designed for) that converts the entire depth buffer back into geometry and then simulate at least twice as much geometry as you have pixels on your screen using physics to shoot a ray from every pixel and likely more than that so you can get more samples, even if you lowered the resolution of the rays.

You would also not be able to get the surface's texture information as in how glossy, rough, reflective, transparent which is vital to knowing where to send the ray, though I suppose you could just do everything the same and give it a sort of Toy Story look.

So yes, technically possible with some major problems and probably years of work, but I don't think your computer will run it very well

(note I don't know how to code shaders, I'm just speaking from the knowledge and experience I have)

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

  • Posts: 1221
1 year 10 months ago #3 by Marty McFly
Ray tracing using the new technologies (Nvidia RTX, Microsoft's DXR), no. But this term is encorporating a LOT of applications.
Following virtual positions and checking reconstructed view positions against that is surely possible (screen-space raytracing). My work in progress screenspace reflections shader does that and I wrote an AO shader that does that as well - all on ReShade:

Warning: Spoiler! [ Click to expand ]


Then, creating a virtual scene like on shadertoy and creating a custom ray tracer, also possible. But "real" raytracing (what you refer to) requires the entire scene and access to more than just color and depth buffer. Most of it isn't even done in shaders.
The following user(s) said Thank You: PureEvilWindom, aaronth07, turgor128, hardsleaz

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

  • Posts: 71
1 year 7 months ago #4 by aaronth07

Ray tracing using the new technologies (Nvidia RTX, Microsoft's DXR), no. But this term is encorporating a LOT of applications.
Following virtual positions and checking reconstructed view positions against that is surely possible (screen-space raytracing). My work in progress screenspace reflections shader does that and I wrote an AO shader that does that as well - all on ReShade:

Warning: Spoiler! [ Click to expand ]


Then, creating a virtual scene like on shadertoy and creating a custom ray tracer, also possible. But "real" raytracing (what you refer to) requires the entire scene and access to more than just color and depth buffer. Most of it isn't even done in shaders.


That's amazing! I was wondering if anything every came from this?

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

  • Posts: 1221
1 year 7 months ago - 1 year 7 months ago #5 by Marty McFly
Battlefield RTX features are denoised via AI, and I couldn't find a sufficiently good and fast denoiser for this that would run on ReShade. If you make the shader noise free enough so a simple denoiser is sufficient by cranking it up, performance is garbage - obviously. If you tone it down so it runs moderately fast, it's so noisy that any denoiser filter will absolutely destroy the result. Since I cannot temporally filter properly, that isn't helping. No one is going to use this filter if it runs with 20 fps.

I'm working in a different direction atm to transition MXAO to some more physically correct approach, that should yield slightly worse results than this at much better performance.
The following user(s) said Thank You: TryOG

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

  • Posts: 71
1 year 7 months ago - 1 year 7 months ago #6 by aaronth07
May I ask what denoiser shader you are using? And what hardware you are using with FPS result? Actual RTX also destroys the game's framerate, so while your RTX shader may not be performance friendly, it's still a way to get RTX like results on games and/or GPU's that don't support RTX. There is also the future to think about. While RTX is a new thing right now, in a few years it will probably be how NVIDIA Gameworks is now (which is basically the standard in games with a much lower performance cost and a much better implementation). An RTX filter for Reshade will be a great way to get RTX like results on older games in a few years, and then of course there is the point I have mentioned above.

If you are no longer working on the RTX shader, would you be willing to share your code? I would love to test it, and play around with it to see if I could get some results.

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