Welcome, Guest.
Username: Password: Remember me

TOPIC: Defog shader

Defog shader 1 year 7 months ago #1

  • 04348
  • 04348's Avatar
  • Offline
  • Posts: 13
  • Thank you received: 11
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 : 00i.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: 1 year 7 months ago by 04348.
The administrator has disabled public write access.

Defog shader 1 year 7 months ago #2

  • Kleio420
  • Kleio420's Avatar
  • Offline
  • Posts: 216
  • Thank you received: 28
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 : 00i.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
The administrator has disabled public write access.

Defog shader 1 year 7 months ago #3

  • 04348
  • 04348's Avatar
  • Offline
  • Posts: 13
  • Thank you received: 11
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: 1 year 7 months ago by 04348.
The administrator has disabled public write access.