Page 1 of 1

Vanilla lightmode has lighting come from nowhere

Posted: Sun Dec 23, 2018 11:18 am
by Nash
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

Re: Vanilla lightmode has lighting come from nowhere

Posted: Sun Dec 23, 2018 2:37 pm
by dpJudas
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.

Re: Vanilla lightmode has lighting come from nowhere

Posted: Sun Dec 23, 2018 3:07 pm
by Graf Zahl
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

Re: Vanilla lightmode has lighting come from nowhere

Posted: Sun Dec 23, 2018 3:28 pm
by dpJudas
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.