Page 1 of 2

GZDoom "Dynamic" Lights: Possible in Software?

Posted: Sat Dec 04, 2010 2:31 am
by Minigunner
I have looked at how GZDoom's dynamic lights are drawn, and since it's basically a brightmap graphic projected onto a plane/wall, with sprite brightness calculated by relative distance from the light source, it may be replicated in software. IMO it seems quite a bit similar to decals and brightmapped sprites/textures. Maybe with some careful coding, we could have GZLights in ZDoom. What do you think?

Re: GZDoom "Dynamic" Lights: Possible in Software?

Posted: Sat Dec 04, 2010 3:40 am
by Graf Zahl
The palette limitations alone would pretty much ensure that it'll look bad. And it still wouldn't be that easy for flats.

Re: GZDoom "Dynamic" Lights: Possible in Software?

Posted: Sat Dec 04, 2010 4:59 am
by Minigunner
If that is the case, then this could wait until ZDoom's possible implementation of hi-color mode (which is pretty damn unlikely as is). Otherwise, the best thing to do with software dynamic lights is to avoid using purple and cyan...

Re: GZDoom "Dynamic" Lights: Possible in Software?

Posted: Sat Dec 04, 2010 2:46 pm
by NeuralStunner
This and 3D floors are about all that defines a "GZDoom only" map/mod. I would be extremely happy to see at least the latter finished, even moreso to see both. I remember the time I spent unable to use GL at all.

(If you could implement this, would it open up the possibility of software brightmaps?)

Re: GZDoom "Dynamic" Lights: Possible in Software?

Posted: Sat Dec 04, 2010 2:48 pm
by Gez
NeuralStunner wrote:This and 3D floors are about all that defines a "GZDoom only" map/mod.
No love for FraggleScript? :P

Re: GZDoom "Dynamic" Lights: Possible in Software?

Posted: Sat Dec 04, 2010 2:59 pm
by NeuralStunner
Gez wrote:No love for FraggleScript?
I can't think of a single mod that uses it. :(

Re: GZDoom "Dynamic" Lights: Possible in Software?

Posted: Sat Dec 04, 2010 3:34 pm
by esselfortium
I think the palette issues could be worked around in the same way that sector lighting and texture choices are made to look good in software, but I don't think any remotely 'easy' implementation of this would really work in software for another, unrelated reason: the existing colormap-based lighting system would likely break the effect unless the dynamic lights could be somehow rendered as a series of circular, dynamically-split partial segs and subsectors with the appropriate light levels' colormaps.

Because drawing them as bright overlays wouldn't really work out with the existing software lighting system, I don't think. Best case implementation that way they'd probably stick out like a sore thumb, especially when all the lighting around them brightens/darkens with distance fading and the dynamic lights don't.

tl;dr: hfgl

Re: GZDoom "Dynamic" Lights: Possible in Software?

Posted: Sat Dec 04, 2010 3:52 pm
by Minigunner
Yeah, software dynlights would probably need quite a bit of work in order for it to look good in software. However, I screenshotted some dynamic lights and converted the images to the Doom palette, and they don't look half bad; basically, the light levels would have to be calculated in 16-bit in order to look almost the same. As for the possible r_visibility troubles, I guess the lights could also be affected by it.

All in all, it seems that the way I'm proposing may consume a shitload of CPU usage, so there would have to be a way around it, or they will just about be useless and not worth the effort. :cry:

Re: GZDoom "Dynamic" Lights: Possible in Software?

Posted: Sat Dec 04, 2010 5:20 pm
by Gez
DelphiDoom is the most advanced software renderer as far as eye candy goes; it has 32-bit color depth, dynamic lights, and fake perspective correction.

I am a bit surprised nobody backported that code to a C/C++ Doom port; but I guess those people interested by these features just go for hardware rendering.

Re: GZDoom "Dynamic" Lights: Possible in Software?

Posted: Sat Dec 04, 2010 5:36 pm
by esselfortium
I was really intrigued by the fake perspective correction as seen in the DelphiDoom website's screenshots, but when I tried it out I found it to actually be rather nauseating in action. :?

Re: GZDoom "Dynamic" Lights: Possible in Software?

Posted: Sat Dec 04, 2010 7:57 pm
by phi108
esselfortium wrote:...the existing colormap-based lighting system would likely break the effect unless the dynamic lights could be somehow rendered as a series of circular, dynamically-split partial segs and subsectors with the appropriate light levels' colormaps.
I've often wondered if the ZDoom colormap light fading could ever be more dynamic, allowing the light to brighten in a circle as it got closer to a bright item, not dependent on the player position anymore. But this would only allow white lights the same as all light fading, unless it could somehow use ZDoom's colored sector lighting.

Re: GZDoom "Dynamic" Lights: Possible in Software?

Posted: Sat Dec 04, 2010 9:31 pm
by Minigunner
I just looked at DelphiDoom, and its "dynlights" are just sprites, while the perspective correction blows.
Wait a minute. The light effects could fit well in software, if they aren't rendered as additive.
The perspective correction seems to just be the widening of the screen towards the bottom (like this: |`| -> /`\ ; it even occurs when looking down :| ). However, that tends to provide even more distortion than no "correction" at all. It should be narrowing of the screen towards the top when looking up ( |`| -> /\ ), and narrowing towards the bottom when looking down ( |`| -> \/ ).
As for 32-bit color, I think that ZDoom would be better off with 16-bit color, considering that ZDoom in itself consumes more resources than DelphiDoom (that is, if the fancy settings aren't enabled), and that ZDoom doesn't use any texture filters that could easily expose the visual disadvantages of 16-bit over 32-bit.

Re: GZDoom "Dynamic" Lights: Possible in Software?

Posted: Sat Dec 04, 2010 11:09 pm
by NeuralStunner
Minigunner wrote:ZDoom doesn't use any texture filters that could easily expose the visual disadvantages of 16-bit over 32-bit.
Meh, in GZDoom especially, I've noticed a distinct lack of color quality in 16-bit color mode (with lighting in particular).

Re: GZDoom "Dynamic" Lights: Possible in Software?

Posted: Sun Dec 05, 2010 6:39 pm
by Amuscaria
Didn't Quake have Dynamic lights in software mode? O_o I'd imagine it would be possible?

Re: GZDoom "Dynamic" Lights: Possible in Software?

Posted: Sun Dec 05, 2010 6:41 pm
by InsanityBringer
Quake's software renderer was also much different than doom's.