Fog Removal Shader

More
5 months 4 days ago - 5 months 4 days ago #1 by Lord Of Lunacy
Fog Removal Shader was created by Lord Of Lunacy
This is my attempt at making a shader that is capable of removing fog (and volumetric lighting) from an image so that effects such as RTGI can be applied without their interference, and then be able to add the fog back in.

Before Removal:


After Removal (w/o Restoration):



RTGI:


RTGI w/ Fog Removal:



The shader can be found on my Github at:
github.com/LordOfLunacy/reshade-shaders/...master/FogRemoval.fx
Last edit: 5 months 4 days ago by Lord Of Lunacy.
The following user(s) said Thank You: jmx777, Tojkar, Viper_Joe, aaronth07, Shodan

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

More
5 months 3 days ago #2 by Martigen
Replied by Martigen on topic Fog Removal Shader
This is amazing! What magic is this?!

I've always thought this is one thing we'll never be able to fix, as AO is using the depth buffer and it's unavoidable, but what a novel solution!

Will definitely check this out later :)

I wonder also if it's possible for Marty to integrate your work, if given permission, into MXAO/RTGI so that it can all be done in the passes performed there?

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

More
5 months 3 days ago #3 by ZabaZu
Replied by ZabaZu on topic Fog Removal Shader
It's essentially an intelligent contrast shader. It's not a perfect solution, but if your goal is to play a game with mxao/rtgi, the negatives are very much worth it (the negatives being it altering the way rtgi/mxao behave, depending on configuration).

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

More
5 months 3 days ago #4 by clayb
Replied by clayb on topic Fog Removal Shader
Wow! (that mountain was completely obscured but there it is, mind blown already).
Isn't isolating fog like a holy grail of Reshade and similar wrappers? Haven't tried it yet, but looks really promising!

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

More
5 months 18 hours ago #5 by supercento
Replied by supercento on topic Fog Removal Shader
It doesn't work for me. Compilation error. I don't use RT

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

More
5 months 18 hours ago #6 by Uncle Crassius
Replied by Uncle Crassius on topic Fog Removal Shader

supercento wrote: It doesn't work for me. Compilation error. I don't use RT


Which Reshade version are you using? If not the latest, try the latest. Other than that, does the error message say anything in red about the reason?

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

More
5 months 13 hours ago #7 by klotim
Replied by klotim on topic Fog Removal Shader
The shader reduced my fps from 42 to 36fps. That's quite a hit considering RTGI also takes 6fps.
Using a 2080Ti on metro exodus maxed out 1440p.

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

More
1 month 3 weeks ago - 1 month 3 weeks ago #8 by Tojkar
Replied by Tojkar on topic Fog Removal Shader
For some reason this shader appears to be completely broken in Control using dx12. It works in some areas but not in others. Also the options menu turns completely black if this shader is enabled.

Not sure if this is isolated to this game or if it's caused by dx12.

EDIT: After testing with dx11 the problem seems to presist in that too.

I have no idea what could cause the menu to blackout, but in-game the problem seems to came at least partly from strong saturation. When in waste burner where the burner glown in very strong yellow and red, the shader has no effect and everything around the burner casts as strong AO as anything else. Confirmed this by desaturating the picture first before applying remove fog and AO and then the shader had clear effect.
Last edit: 1 month 3 weeks ago by Tojkar.

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