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

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

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

Postby Nash » Mon Jun 10, 2019 8:47 am

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 10 times
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

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

Postby Nash » Mon Jun 10, 2019 9:18 am

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.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

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

Postby _mental_ » Tue Jun 11, 2019 5:11 am

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.
_mental_
 
 
 
Joined: 07 Aug 2011

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

Postby Nash » Tue Jun 11, 2019 5:18 am

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
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

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

Postby Graf Zahl » Tue Jun 11, 2019 5:24 am

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.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

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

Postby _mental_ » Wed Jun 12, 2019 1:50 am

Fixed in 7e90105.
_mental_
 
 
 
Joined: 07 Aug 2011

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

Postby drfrag » Wed Jun 12, 2019 7:28 am

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
drfrag
I.R developer, I.R smart
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain

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

Postby Graf Zahl » Wed Jun 12, 2019 7:31 am

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
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

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

Postby drfrag » Wed Jun 12, 2019 8:56 am

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.
User avatar
drfrag
I.R developer, I.R smart
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 1 guest