Vanilla lightmode has lighting come from nowhere

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

Moderator: GZDoom Developers

User avatar
Nash
 
 
Posts: 17326
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Vanilla lightmode has lighting come from nowhere

Post 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
You do not have the required permissions to view the files attached to this post.
dpJudas
 
 
Posts: 2893
Joined: Sat May 28, 2016 1:01 pm

Re: Vanilla lightmode has lighting come from nowhere

Post 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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48375
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Vanilla lightmode has lighting come from nowhere

Post 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
dpJudas
 
 
Posts: 2893
Joined: Sat May 28, 2016 1:01 pm

Re: Vanilla lightmode has lighting come from nowhere

Post 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.

Return to “On Hold Bugs”