All dynamic lights are normal lights

Moderator: 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.

All dynamic lights are normal lights

Postby Xane123 » Sat Sep 16, 2017 4:17 pm

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
Software renderer (all lights are the normal type)
opengl.jpg
OpenGL (correct)

Here's the test WAD.
test_badlights.wad
Test WAD. A small room with SHAWN2 and three lights, one of each type.
(1.78 KiB) Downloaded 22 times
User avatar
Xane123
Mary's Magical Adventure Developer
 
Joined: 24 Nov 2015
Location: Martinsburg, WV
Discord: Xane123#3770

Re: All dynamic lights are normal lights

Postby dpJudas » Sat Sep 16, 2017 6:48 pm

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.
dpJudas
 
 
 
Joined: 28 May 2016

Re: All dynamic lights are normal lights

Postby Xane123 » Sun Sep 17, 2017 6:00 pm

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
Xane123
Mary's Magical Adventure Developer
 
Joined: 24 Nov 2015
Location: Martinsburg, WV
Discord: Xane123#3770

Re: All dynamic lights are normal lights

Postby Graf Zahl » Wed Feb 28, 2018 5:30 am

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

Re: All dynamic lights are normal lights

Postby dpJudas » Wed Feb 28, 2018 5:50 am

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.
dpJudas
 
 
 
Joined: 28 May 2016

Re: All dynamic lights are normal lights

Postby Rachael » Wed Feb 28, 2018 7:39 am

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
Rachael
QZDoom + Webmaster
 
Joined: 13 Jan 2004

Re: All dynamic lights are normal lights

Postby Graf Zahl » Wed Feb 28, 2018 7:47 am

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

Re: All dynamic lights are normal lights

Postby Rachael » Wed Feb 28, 2018 7:50 am

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.
User avatar
Rachael
QZDoom + Webmaster
 
Joined: 13 Jan 2004


Return to Software Renderer Bugs

Who is online

Users browsing this forum: No registered users and 1 guest