Wrong light level calculation with "Fog Mode" activated

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Wrong light level calculation with "Fog Mode" activated

Post by Tormentor667 »

Dear developers,

I have discovered something during working on my latest map for Blade of Agony and adding a light gradient to an area of the map with sectors. The following sectors have a light level from 144 to 96, it's set up in a linear way. Even though it IS definitely linear, there is a heavy jump from 129 to 126 (5th to the 6th panel from the left). 3 units light level shouldn't make such a difference:
2019-12-25_183038.jpg
I played around with the graphic settings and found out that switching "Fog Mode" from "Standard" (or "Radial") to "None" fixes the problem:
2019-12-25_183738.jpg
But the problem here is: These sectors do not have fog at all. I guess something different is going on here, maybe a miscalculation or an engine bug.

Best regards,
Dan
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Wrong light level calculation with "Fog Mode" activated

Post by Graf Zahl »

The thing is, most light modes are not linear, if you absolutely need linear lighting you have to force light mode 1 (bright) in MAPINFO and adjust the lighting levels in your map, because due to the linear falloff this light mode is a lot brighter than the others.

Light modes 2, 3, 8 and 16 are supposed to emulate the falloff of the original colormap Doom comes with and that definitely has some kinks that may screw with lighting.
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: Wrong light level calculation with "Fog Mode" activated

Post by Tormentor667 »

Well, I had suspected something like that, and that's why I tried all the Doom light methods and also tried a MAPINFO entry that looks like this:

Code: Select all

map SM02 lookup "SM02"	//Tormentor667
{
	levelnum = 152
	music = "SM02_MUS"
	cluster = 1
	EvenLighting 
	lightmode = 1
	aircontrol = 0.8
}
2019-12-25_191244.jpg
Obviously GZDoom doesn't care - neither about the MAPINFO setting nor about the setting in the options. What do I miss?
Last edited by Tormentor667 on Wed Dec 25, 2019 12:26 pm, edited 1 time in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Wrong light level calculation with "Fog Mode" activated

Post by Graf Zahl »

Can you PM me the map so that I can have a look myself?
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: Wrong light level calculation with "Fog Mode" activated

Post by Tormentor667 »

Well, not necessary anymore, I tried "lightmode = 0" (standard) and it worked. The problem was indeed "lightmode = 1" and if a lightmode has been set to a map, you can't override it with the controls given in the options menu. Thanks for the help finding this.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Wrong light level calculation with "Fog Mode" activated

Post by Graf Zahl »

Ah, right. Lightmode 1 has a linear light ramp but a non linear fog ramp to increase the depth fading for the lower light levels.
Post Reply

Return to “Closed Bugs [GZDoom]”