Defog shader

  • 04348
  • Topic Author
More
9 years 5 days ago - 9 years 4 days ago #1 by 04348 Defog shader was created by 04348
Hi :)

I have a very simple idea for a shader that reduce the white fog found in many games :
add inverted depth-buffer to pixels, which darken things far from the screen, but ignore sky ( for depth-buffer completely white).
I don't know if it could work, but I made some try with Gimp and I got that :

Before : i.imgur.com/3CDXNwC.jpg 0000000 i.imgur.com/CjBoVWt.jpg
After : 00 i.imgur.com/TicPggu.jpg 00000000 i.imgur.com/6cgmb5k.jpg
Strenght of the effect and tint could be easily changed, :)

Maybe increase the contrast in the darkened area could give a better result :cheer:

I don't have the skills to program that, and I don't even know if it's a good idea :p

EDIT : Okay, I get to code this shader by editing the Display-depth, but there is only one issue left : I can't get DoF effect after this shader, so it look a bit odd ^^ : i.imgur.com/vUHL44q.jpg
And I must add a curve setting too :]
Last edit: 9 years 4 days ago by 04348.

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

  • Kleio420
More
9 years 4 days ago #2 by Kleio420 Replied by Kleio420 on topic Defog shader

04348 wrote: Hi :)

I have a very simple idea for a shader that reduce the white fog found in many games :
add inverted depth-buffer to pixels, which darken things far from the screen, but ignore sky ( for depth-buffer completely white).
I don't know if it could work, but I made some try with Gimp and I got that :

Before : i.imgur.com/3CDXNwC.jpg 0000000 i.imgur.com/CjBoVWt.jpg
After : 00 i.imgur.com/TicPggu.jpg 00000000 i.imgur.com/6cgmb5k.jpg
Strenght of the effect and tint could be easily changed, :)

Maybe increase the contrast in the darkened area could give a better result :cheer:

I don't have the skills to program that, and I don't even know if it's a good idea :p

EDIT : Okay, I get to code this shader by editing the Display-depth, but there is only one issue left : I can't get DoF effect after this shader, so it look a bit odd ^^ : i.imgur.com/vUHL44q.jpg
And I must add a curve setting too :]

you have no depth buffer access in guild wars 2

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

  • 04348
  • Topic Author
More
9 years 4 days ago - 9 years 4 days ago #3 by 04348 Replied by 04348 on topic Defog shader
Finally got something better, working with the McFX DoF :)

i.imgur.com/qtwD1hs.jpg | i.imgur.com/zVSuJcy.jpg

Now time to do some math for add more control :3

Edit :

you have no depth buffer access in guild wars 2

When you don't move, Depth buffer work, and also : reshade.me/forum/shader-troubleshooting/...uild-wars-2?start=12
Last edit: 9 years 4 days ago by 04348.

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.