Vanilla lightmode has lighting come from nowhere

These bugs do plan to be resolved, when they can be.

Moderator: GZDoom Developers

Vanilla lightmode has lighting come from nowhere

Postby Nash » Sun Dec 23, 2018 12:18 pm

With vanilla lightmode, it seems that there's some lighting coming from... no where? Especially visible on the HUD gun model. Just stand in a completely dark area in the test map, and move the mouse around. You'll see the lighting on the model change.

With other lightmodes, the model would have a completely flat colour if you aren't standing near any of the dynamic lights. Not sure if this is a bug or intentional though?! I mean it sorta looks cool. Even though the lighting is wrong, it looks much better than flat lighting... =P

There are 2 other issues I've noticed with this same test WAD though, should I report them separately?

1) Gun model bobbing doesn't appear to be interpolated (it has that 35 FPS look to it)
2) When standing completely in the dark, the gun model is still bright. When you turn on the chasecam, you can see that your player sprite in the world is pitch black.

EDIT: woops forgot to attach file
(35.79 KiB) Downloaded 15 times
User avatar
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Vanilla lightmode has lighting come from nowhere

Postby dpJudas » Sun Dec 23, 2018 3:37 pm

This is actually intended behavior.

The original Doom light uses different math for lines vs flats. As GZDoom can have faces pointing in many other directions I coded it so that the face normal decides which math is being used. For face normals pointing horizontally it uses line light and for vertical it uses the flat math. As you look up and down you change the direction the various faces of the gun point in and that in turn changes how it is lit.
Joined: 28 May 2016

Re: Vanilla lightmode has lighting come from nowhere

Postby Graf Zahl » Sun Dec 23, 2018 4:07 pm

Do you really think that the just normal should decide this? IMO this should be a separate flag being passed to the renderer. Sure, for map geometry this is ok, but certainly not for models
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
Joined: 19 Jul 2003
Location: Germany

Re: Vanilla lightmode has lighting come from nowhere

Postby dpJudas » Sun Dec 23, 2018 4:28 pm

Using a normal was the easiest way of dealing with it, since the alternative required setting up that flag. If you do create such a flag, what is a model? a wall or a flat?

Technically the vanilla light math is pretty weird/broken from the start as it makes no sense to use different math for walls vs flats. The walls are by far the weirdest as the light depends on the angle between the first line vertex (!) and the camera's view direction.
Joined: 28 May 2016

Return to On Hold Bugs

Who is online

Users browsing this forum: No registered users and 0 guests