MAPINFO lightmode 16 doesn't work g4.2pre-142-g324a720d5

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
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

MAPINFO lightmode 16 doesn't work g4.2pre-142-g324a720d5

Post by Nash »

When setting a map's "lightmode" property to 16 (Vanilla), the map just ends up getting the "Software" lighting instead. It seems that lightmode 16 via MAPINFO just does not work.
Attachments
LightModeTest.pk3
(3.8 KiB) Downloaded 32 times
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: MAPINFO lightmode 16 doesn't work g4.2pre-142-g324a720d5

Post by Nash »

I have updated the OP with a test file. Goes without saying that your current lightmode user setting (in the Options menu) must be set to something else other than Vanilla to actually see that the feature isn't working.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: MAPINFO lightmode 16 doesn't work g4.2pre-142-g324a720d5

Post by _mental_ »

If I got everything right, light mode from MAPINFO should override user's choice.
In other words, gl_light mode CVAR should have no effect when light mode is defined.
Currently, the latter is ignored as the CVAR is read directly.

In case my assumptions are correct, here is PR with the fix.
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: MAPINFO lightmode 16 doesn't work g4.2pre-142-g324a720d5

Post by Nash »

While those assumptions are correct, what really happens is that MAPINFO lightmode gets ignored only for setting 16. For other lightmodes, (all of them up to 8), it works exactly as your assumption - meaning, the MAPINFO override value is used, and changing the CVar has no effect.

But when lightmode 16 specifically is used as a MAPINFO override, lightmode 8 gets enforced in the game view.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: MAPINFO lightmode 16 doesn't work g4.2pre-142-g324a720d5

Post by Graf Zahl »

This is due to how the lightmodes get checked. The light mode doesn't get passed to the shader directly, it is only being used for calculating light levels on the CPU side, but for software lighting this must be done in the shader. And this value wasn't properly set up because apparently when implementing this, it was overlooked that the light mode can not only be set by the CVAR but also through MAPINFO.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: MAPINFO lightmode 16 doesn't work g4.2pre-142-g324a720d5

Post by _mental_ »

Fixed in 7e90105.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: MAPINFO lightmode 16 doesn't work g4.2pre-142-g324a720d5

Post by drfrag »

This can't be fixed in the legacy build AFAIK, no big deal tough. I missed the MAPINFO part hidden in "- use symbolic constants for the light modes." since there were a lot of conflicts.
Back then lightmode was in level_info_t and not in HWDrawInfo.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: MAPINFO lightmode 16 doesn't work g4.2pre-142-g324a720d5

Post by Graf Zahl »

Forget it. The software light modes are hardly relevant for hardware that have no shader support. Those on better hardware shouldn't use the legacy builds anyway.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: MAPINFO lightmode 16 doesn't work g4.2pre-142-g324a720d5

Post by drfrag »

That's what i'm going to do, it's this commit in the middle of the level refactor: "- changed light mode handling of the hardware renderer so that it only operates on local copies but doesn't alter the level's setting."
No big deal, ZD software it's used instead.
Post Reply

Return to “Closed Bugs [GZDoom]”