All dynamic lights are normal lights

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!
User avatar
Xane123
Posts: 165
Joined: Tue Nov 24, 2015 1:58 pm
Graphics Processor: nVidia (Modern GZDoom)
Location: Inwood, WV

All dynamic lights are normal lights

Post by Xane123 »

I noticed when going through my levels of my TC today that my second level, a city at nighttime, appeared to be bright instead of the buildings fading out into the darkness below. I went there again and it was fine...I then started suspecting the software render may be rendering the wrong type of light and saw that was what was happening.

I made a test map that has one of each light and saw it was worse than I thought; Normal, additive, and subtractive lights are all rendered as normal dynamic lights in the software renderer!
software.jpg
opengl.jpg
Here's the test WAD.
test_badlights.wad
You do not have the required permissions to view the files attached to this post.
dpJudas
 
 
Posts: 2890
Joined: Sat May 28, 2016 1:01 pm

Re: All dynamic lights are normal lights

Post by dpJudas »

This is a known limitation of the software renderer. It is technically trivial to fix, but I fear it will produce a measurable performance drop in doing so. At least it would require a second set of drawers to prevent that.

For what it is worth, I'm not even sure if the software lights are "normal" or "additive" compared to what the GL renderer does. There seems to be some kind of desaturation involved with normal dynlights, if I read the shader code right. The software renderer does not do that.
User avatar
Xane123
Posts: 165
Joined: Tue Nov 24, 2015 1:58 pm
Graphics Processor: nVidia (Modern GZDoom)
Location: Inwood, WV

Re: All dynamic lights are normal lights

Post by Xane123 »

Hmm, maybe that should be a toggle-able option to enable/disable having additive/subtractive lights. I agree about how they look, though; The software renderer's idea of "fog" and how the lights look are totally different than the OpenGL renderer.

Maybe the fog should be altered for consistency too but this isn't a feature request thread, this is a bug report.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48326
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: All dynamic lights are normal lights

Post by Graf Zahl »

I don't think that handling additive lights is necessary. But subtractive lights are better skipped entirely instead of rendering them additively - that only increases the perception of faulty behavior.

Regarding the desaturation that has been mentioned - that is related to the sector color desaturation feature. To make lights look right it also needs to apply to the light being emitted by objects whose color got desaturated. Having a grayed version of a BFG projectile emit bright green light just looks wrong.
dpJudas
 
 
Posts: 2890
Joined: Sat May 28, 2016 1:01 pm

Re: All dynamic lights are normal lights

Post by dpJudas »

Makes sense. I wonder if I could get away with desaturating the light color when building the light list for the drawer. And thinking about it, maybe I can support subtractive lights by making the light color a negative value.
User avatar
Rachael
Admin
Posts: 13084
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: All dynamic lights are normal lights

Post by Rachael »

I think you can, dpJudas. But remember one thing about subtractive lights:

No matter what colour they are, their hue is flipped 180 degrees. I don't know the exact design decisions behind that, it actually kind of frustrates me, but that is what it is. So a subtractive light of (255,0,0) actually renders as (0,255,255) in the engine. I can give some quicky math formulae if you need to preserve the luminosity and saturation values while flipping the hues, without actually breaking the colours down into HSV values.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48326
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: All dynamic lights are normal lights

Post by Graf Zahl »

Rachael wrote:I think you can, dpJudas. But remember one thing about subtractive lights:

No matter what colour they are, their hue is flipped 180 degrees. I don't know the exact design decisions behind that
I think Timmie did it so that the effect it generates corresponds to the given color, i.e. make a red subtractive light and you get a red shadow.
User avatar
Rachael
Admin
Posts: 13084
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: All dynamic lights are normal lights

Post by Rachael »

That's the only thing that makes sense. It feels way too hand-holdy to me, though, but hey I wasn't the one who designed them.

I would've done it so that a red subtractive light results in a proper cyan blob from the source.

Return to “Classic ("Carmack") Software Renderer Bugs”