AO Tweaks to deal with fog

More
6 months 1 week ago - 6 months 1 week ago #1 by SavvyKraken
AO Tweaks to deal with fog was created by SavvyKraken
As many people know, Ambient Occlusion is an effect that is generally applied to the entire image regardless of how bright it is. However, after finding that AO basically stencils on top of fog in games like Kotor 2, I am left wondering if there's a way to remove some of the AO based on how much Gamma is present in the scene. (Since the fog is essentially lighting up the scene so brightly that the AO is bleeding into it)
 
Basically I am proposing something like this   
into this  if possible.
Last edit: 6 months 1 week ago by SavvyKraken.

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

More
6 months 6 days ago #2 by canceralp
Replied by canceralp on topic AO Tweaks to deal with fog
I believe what you are looking for is a shader named Reveil. It comes as two shaders; Reveil top, Reveil Bottom. Place MXAO between them. Adjust Reveil settings as like:
Strength: -0.667
Depth Sensitivity: -1.000. (notice the minus sign)

What this does is, Reveil Top saves a picture of the frame. But, the closer the objects in the picture, more transparent they are saved. In the end there is a picture with visible details in greater distances and less visible (or non-visible) details in closer object.

Then MXAO does it's thing. Finally Reveil Bottom places the semi-transparent picture on top of MXAO'ed picture. That way, if MXAO is bleeding through a smoke, smoke is placed back on top of it and the depth order is preserved.

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

More
6 months 4 days ago - 6 months 4 days ago #3 by SavvyKraken
Replied by SavvyKraken on topic AO Tweaks to deal with fog
Thank you very much for the link.

I am having a problem with the shader you sent, though.. I can send this to the author's personal page, but I figure it's probably worth asking here first, (Not sure how Necros are treated on this Forum, so I'm being careful)

The Reveil shader is throwing an error. "error c7608 OpenGL does not allow using Discard in this profile" Not exactly well versed in how OpenGL works, but does this mean that the shader won't work on certain APIs, or rather is there a relatively easy way to fix it?
Last edit: 6 months 4 days ago by SavvyKraken.

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