VOGONS


Source DirectX9 grey fog bug

Topic actions

Reply 20 of 46, by ZellSF

User metadata
Rank l33t
Rank
l33t
MilkeyWilkey wrote on 2020-05-12, 14:43:

@ZellSF, check your native nvidia sin screenshots closely, there is fog, but it's further away, just like in HL2. Also, I think as you have what seems to be a correct look with sin you can also try out 1.0 HL2 and see how it looks for you

There's also the Sin trailer that showcase what seems to be correct look https://www.youtube.com/watch?v=BYzQ89RSyHg

For the screenshots I posted, no even if the fog is visible in the Nvidia screenshot it's way too absent for an intentional effect IMO.

However, the Sin trailer does seem to indicate that the thinner fog is what is intended. Weird how it only seems to work on Nvidia cards (then again it's a Nvidia "sponsored"game).

Reply 21 of 46, by MilkeyWilkey

User metadata
Rank Newbie
Rank
Newbie
ZellSF wrote on 2020-05-12, 15:36:

Weird how it only seems to work on Nvidia cards (then again it's a Nvidia "sponsored"game).

Funny, but it turned out to not be the case. I've found a notebook with AMD Radeon HD7500 (Windows 7) and it worked flawlessly. And at the same time, on the other notebook with Geforce 710M (Windows 10) it is buggy.
btw, all of my previous shots was taken from RX 590 Windows 10

Attachments

  • lab.2-HD7500c.jpg
    Filename
    lab.2-HD7500c.jpg
    File size
    191.87 KiB
    Views
    2938 views
    File license
    Fair use/fair dealing exception
  • lab.2-HD7500.jpg
    Filename
    lab.2-HD7500.jpg
    File size
    207.92 KiB
    Views
    2938 views
    File license
    Fair use/fair dealing exception
  • title.2-HD7500.jpg
    Filename
    title.2-HD7500.jpg
    File size
    265.33 KiB
    Views
    2938 views
    File license
    Fair use/fair dealing exception

Reply 23 of 46, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Found this
https://www.nvidia.com/object/winnt_77.72.html

Geforce 6800: Half-Life 2 fog is different when using ATI hardware.
This is not an NVIDIA bug, but rather an issue with the application.

How To Ask Questions The Smart Way
Make your games work offline

Reply 25 of 46, by Dege

User metadata
Rank l33t
Rank
l33t

Yes, sorry, I kinda thought it's been solved by settings nVidia as video card type.

I tested your savegame with HL2 but I don't understand the result. When developing DX9 I remember I had to select GF5700 (or set card type to nVidia) to get HL2 to work (render) properly.
This time I just tried the game with vanilla dgVoodoo settings and DX9+ selected in the game and got this:

HALF-LIFE-2-2020-05-26-14-56-00.png

HALF-LIFE-2-2020-05-26-14-56-34.png

HALF-LIFE-2-2020-05-26-15-01-41.png

HALF-LIFE-2-2020-05-26-15-01-56.png

Isn'it how it should look? Or I don't have fog enabled at all? 😀
I couldn't yet (for the time being) try Sin because I don't have it.

Last edited by Dege on 2020-05-26, 13:17. Edited 1 time in total.

Reply 26 of 46, by Dege

User metadata
Rank l33t
Rank
l33t
DosFreak wrote on 2020-05-25, 20:41:

Found this
https://www.nvidia.com/object/winnt_77.72.html

Geforce 6800: Half-Life 2 fog is different when using ATI hardware.
This is not an NVIDIA bug, but rather an issue with the application.

Hmm... What could that issue be?
Fogging has 3 different types in DX with defined formulas to calc by, how can an application be an issue here if the driver works as expected?

My only tip is that there is a little difference between DX8/9 in the vertex/pixel pipeline for fogging and HL2 relies (relied?) on the DX8 one.

Reply 28 of 46, by Dege

User metadata
Rank l33t
Rank
l33t

It turns out that what we believed to be fog, that's not fog... It just looks like fog.

I checked out Sin with DX8 and DX9 level renderer (through dgVoodoo) and debugged the shaders for a problematic part. The calculated fog values were the same with both DX8/9 levels…
Also, in both cases the sampled texture is multiplied by an intensity factor (coming from the game) in the shader.

The difference between the two cases:
- DX9 level: the game renders parts of the scene with SRGB textures and SRGB rendertarget. SRGB scales the texture input/shader output from/to the linear space, so the intensity changes (it becomes too bright giving the impression of dense fog)
- DX8 level: SRGB is unsupported

For DX9 the SRGB part seems to be broken. Either it shouldn't be enabled or the intensity factor used in the shader should be slightly different. I had a look into what if SRGB is completely disabled but then it's too dark.

DX9 With SRGB:
Si-N-Episodes-2020-05-26-18-59-35.png

DX9 Without SRGB
Si-N-Episodes-2020-05-26-18-57-15.png

So, nVidia seems to be right, it's an issue with the application. 😖
What I don't understand however, how does this game looks perfectly for me natively (nVidia card)? They added a built-in patch in the driver?
Or, the engine selects the intensity value depending on hw vendor value and various driver cap bits?

(My HL2 version is probably a fixed version and that's why I don't get the issue with that.)

Reply 30 of 46, by MilkeyWilkey

User metadata
Rank Newbie
Rank
Newbie

Allright, I think I've found a fix... and it was incredibly stupidly simple. just set the compatibility to WinXP SP2 on the exe and it all works fine, checked both hl2 and sin on nvidia laptop. haven't tested on amd yet but I'd bet it's the same story

Reply 32 of 46, by Bubblesix

User metadata
Rank Newbie
Rank
Newbie

Trying to run the Half-Life 2 2153 build on an AMD RX 560. I get the nasty bug with the flashlight and the fog issue without dgvoodoo.
Dgvoodoo fixes the flashlight, but the fog problem persists even when Windows XP compatibility mode is enabled. The fog problem worsens on the coast levels.
Setting the game to DX8 fixes the fog but worsens the water and makes the game crash on the coast levels.

Here's a comparison of how fog looks now with dgvoodoo and how it should look:

C0T8BKE.jpeg

4ioX8wg.jpeg

And, no dgvoodoo, the problem can be completely resolved by swapping my card for an older NVDIA card. I suspect that even the most recent NVIDIA cards might work without issues.
Of course, I'd prefer it to work perfectly with my current AMD card. There are numerous minor differences that make the day one build preferable to me. It's unfortunate that this isn't a more widely recognized issue; I believe there's no way to even run the earliest build through steam. Dgvoodoo almost solves everything except the fog issue, which just can't be glanced over.

Reply 33 of 46, by MilkeyWilkey

User metadata
Rank Newbie
Rank
Newbie

I've had this bug with WinXP compatibility too playing on Radeon RX590. But to my surprise it is gone now after some driver update. My current drivers are 22.5.2, windows 10. I only hope it won't come back in any time soon

Reply 34 of 46, by MilkeyWilkey

User metadata
Rank Newbie
Rank
Newbie

well, apparently it's not entirely fixed 🤣. First, it looks mostly ok in Half-Life 2. But comparing to your shot it still has a bit of bug going

20220703174954_1.jpg
Filename
20220703174954_1.jpg
File size
445.59 KiB
Views
2155 views
File license
CC-BY-4.0

But it's totally off in SIN - it looks as bad as it ever was. this makes me want investigate other source games, namely Vampire the mascarade

oh, and, the pun was not intended 😁

Reply 35 of 46, by Dege

User metadata
Rank l33t
Rank
l33t

TBH I don't know how it works natively on NV hw. They might support it at driver level through a game profile or sg like that.
I described in my latest post what I found. It's not fog, but SRGB textures used with bad modulation factors.
I think I read somewhere that Valve patched the game many years later (not the early build, it's true), maybe because of this problem (I don't know)?

Reply 38 of 46, by Bubblesix

User metadata
Rank Newbie
Rank
Newbie
Dege wrote on 2022-07-05, 10:58:

TBH I don't know how it works natively on NV hw. They might support it at driver level through a game profile or sg like that.
I described in my latest post what I found. It's not fog, but SRGB textures used with bad modulation factors.
I think I read somewhere that Valve patched the game many years later (not the early build, it's true), maybe because of this problem (I don't know)?

Thanks for the reply, Dege! I think that the issue is definitely related to fog in some manner because I can get rid of it by disabling fog through the console (fog_override 1). Also, dgvoodoo does something to lessen the bleach effect:


(default DX9)
6Fsvmd9.png
(dgvoodoo Virtual 3D Accelerated Card DX9)
tsBc5nV.png
(dgvoodoo GeForce 5700 Ultra DX9)
5ClwTQV.png
(dgvodoo GeForce 5700 Ultra DX8)
lNEcrtw.png
(default DX8)
Ob7WHYN.png
(default DX9 fog_override 1)
SJQJswH.png

Here's some info I found. Apparently, it was causing a lot of trouble for Counter-Strike Source players around late 2006 to early 2007 on the new Nvidia 8800 cards, which prompted players to pester both Valve and Nvidia for a fix.
Here's a response from Valve Support to an 8800GTX member suffering from the fog issue:

Hello Stephen, The Source Engine and Half-Life 2 were released well before any of the 8800 cards. The game runs well without this issue on the cards that were available at the time of release. Why would Nvidia release a card and drivers that could correctly display graphics in one of the most popular 3d games. I believe this is an error on Nvidia's part, and the fix we have provided is to help our gamers. We can't control the drivers or the hardware they release. Our fix minimizes Nvidia's Geometry error. The fix for the other Source games involved changing the fog distance. These changes affected HL2:EP1, DoD:S, and CS:S. I would expect to see an update for HL2 later on, but I honestly do not have a time frame for you. I do apologize for this inconvenience. I understand how frustrating it must be to purchase a top of the line video card and not have it work properly in some of your games. I have given you as much information as I have on the topic right now.

Apparently, it was fixed by Nvidia in the beta 1 5 8 . 2 4 drivers on May 2, 2007:

GeForce 8800 GTX: Half Life 2–fog is broken or misapplied.
This fix requires the user to update their Valve Source‐based games to the latest
versions of the game engines.

And since then, Valve has updated their Source games several times, botching some features along the way but ensuring that they run on modern hardware. Of course, Sin remains broken on AMD and Intel graphics cards because it's not a Valve game.