Making fog look good in GZDoom.
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
- Deathmatcher
- Posts: 120
- Joined: Thu Dec 11, 2003 12:16 pm
Making fog look good in GZDoom.
I took the GZDoom 1.50 release as an incentive to see how my current project (made for ZDoom) would look like under the GL renderer. Surprisingly good, but some of my maps use outsidefog. In ZDoom, I already had the issue that the transition from foggy to non-foggy (interior) sectors looked very weird, because the seperating linedef would appear as a solid wall of fog. I resolved that issue by applying higher light levels to certain sectors. Specifically, I applied light level 255 to "roof light" sectors within interior rooms to virtually remove the fog effect for these sectors.
In GZDoom, however, I have the same issue again. I understand it that the GL renderer does not attenuate fog level with increasing light level, like the software renderer does? If this is correct, I don't see any level design means to "de-uglify" the sectors in question. I looked into http://zdoom.org/wiki/MAPINFO_options_f ... L_renderer but this didn't really help to resolve my problem.
Is there any technique (mapinfo command usage I'm not aware of or level design trick) that removes the ugly "walls of fog" when going from a fog sector to a non-fog sector? Is there any way to disable fog in a certain sector entirely?
In GZDoom, however, I have the same issue again. I understand it that the GL renderer does not attenuate fog level with increasing light level, like the software renderer does? If this is correct, I don't see any level design means to "de-uglify" the sectors in question. I looked into http://zdoom.org/wiki/MAPINFO_options_f ... L_renderer but this didn't really help to resolve my problem.
Is there any technique (mapinfo command usage I'm not aware of or level design trick) that removes the ugly "walls of fog" when going from a fog sector to a non-fog sector? Is there any way to disable fog in a certain sector entirely?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Making fog look good in GZDoom.
Don't use light level 255. Use something a bit less. 255 is fullbright which will activate the fog boundaries.
- Deathmatcher
- Posts: 120
- Joined: Thu Dec 11, 2003 12:16 pm
Re: Making fog look good in GZDoom.
This did not resolve the problem. I set the light level just 10 units above the surrounding interior sector. It still looks ugly, as you can see on the screenshot.
- Attachments
-
- fog example GLZDoom (no texture filtering)
- example_fog.jpg (91.04 KiB) Viewed 1534 times
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Making fog look good in GZDoom.
Please PM me the map. That shouldn't happen.
- Caligari87
- Admin
- Posts: 6227
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
- Contact:
Re: Making fog look good in GZDoom.
I, too would like some information on making fog like this look good, considering that my next project will make a lot of use of it.


- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Making fog look good in GZDoom.
With the test WAD ZDoom produced a boundary between the 176 sector and the rest but not the 255 sector. This is to be expected because in the software renderer 255 means fullbright, i.e. no fog. That particular check was missing in GZDoom.
But what you failed to mention here was that you were talking about foggy sectors in a non-foggy area. I have the strange feeling that your entire setup is not going to work well, considering that your skylights were fog-less to begin with - which is why they had no fog boundaries in ZDoom.
But what you failed to mention here was that you were talking about foggy sectors in a non-foggy area. I have the strange feeling that your entire setup is not going to work well, considering that your skylights were fog-less to begin with - which is why they had no fog boundaries in ZDoom.
- Salad Viking
- Posts: 752
- Joined: Tue Apr 20, 2010 8:58 pm
- Location: In high orbit
Re: Making fog look good in GZDoom.
Graf is right. What you should do is use some "fake fog," i.e. use a translucent white midtexture that fades out as it extends down. A lot of wads use this trick.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Making fog look good in GZDoom.
I think all problems shown by this WAD are fixed now. No idea if it's going to help you though.
- Deathmatcher
- Posts: 120
- Joined: Thu Dec 11, 2003 12:16 pm
Re: Making fog look good in GZDoom.
I'm not really sure what to make of this now. Do you mean that you added a 255 = fullbright check to the GZDoom code base, which will be in the next release?
Apart from that: The foggy sectors in a non-foggy area are just one of the two issues. The other issue is that the same fog boundaries show up when being in a foggy area and looking at the facade of a building, which has a non-foggy sector at its fringe. I think this is more easily fixed by adding the 87 sector special to the fringe sector, though..
Apart from that: The foggy sectors in a non-foggy area are just one of the two issues. The other issue is that the same fog boundaries show up when being in a foggy area and looking at the facade of a building, which has a non-foggy sector at its fringe. I think this is more easily fixed by adding the 87 sector special to the fringe sector, though..
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Making fog look good in GZDoom.
That problem is present in ZDoom, too - and sector type 87 is meant precisely for such situations.
- Deathmatcher
- Posts: 120
- Joined: Thu Dec 11, 2003 12:16 pm
Re: Making fog look good in GZDoom.
Good to know, thanks.
Sorry for asking again but did you add a fullbright fix for the next GZDoom release? I'm not sure about that.
Sorry for asking again but did you add a fullbright fix for the next GZDoom release? I'm not sure about that.
- Deathmatcher
- Posts: 120
- Joined: Thu Dec 11, 2003 12:16 pm
Re: Making fog look good in GZDoom.
Awesome. Thanks, both of you. 

- The Ultimate DooMer
- Posts: 2109
- Joined: Tue Jul 15, 2003 5:29 pm
- Location: Industrial Zone
Re: Making fog look good in GZDoom.
I'm going to bump this, because I believe this change has caused a negative effect:
Check these screens, the first two with r880, the last two with r892.
http://img841.imageshack.us/i/880over.png/
http://img39.imageshack.us/i/880under.png/
http://img338.imageshack.us/i/892over.png/
http://img444.imageshack.us/i/892under.png/
Note that 892 is screwed up compared to 880. Given the use of Sector_SetFade in the control sector to produce the Boom-esque coloured milkiness under the water, one can assume that it's something to do with the fog changes in 890.
Check these screens, the first two with r880, the last two with r892.
http://img841.imageshack.us/i/880over.png/
http://img39.imageshack.us/i/880under.png/
http://img338.imageshack.us/i/892over.png/
http://img444.imageshack.us/i/892under.png/
Note that 892 is screwed up compared to 880. Given the use of Sector_SetFade in the control sector to produce the Boom-esque coloured milkiness under the water, one can assume that it's something to do with the fog changes in 890.
Last edited by The Ultimate DooMer on Tue Sep 07, 2010 4:16 pm, edited 1 time in total.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Making fog look good in GZDoom.
I can't deduce anything from your screenshots. Fact is, the old calculations were flat out wrong.