GZDoom "Dynamic" Lights: Possible in Software?

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
User avatar
Minigunner
Posts: 754
Joined: Mon Dec 28, 2009 5:13 pm

GZDoom "Dynamic" Lights: Possible in Software?

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

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

Post 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.
User avatar
Minigunner
Posts: 754
Joined: Mon Dec 28, 2009 5:13 pm

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

Post 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...
User avatar
NeuralStunner
 
 
Posts: 12325
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

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

Post 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?)
Gez
 
 
Posts: 17833
Joined: Fri Jul 06, 2007 3:22 pm

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

Post by Gez »

NeuralStunner wrote:This and 3D floors are about all that defines a "GZDoom only" map/mod.
No love for FraggleScript? :P
User avatar
NeuralStunner
 
 
Posts: 12325
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

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

Post by NeuralStunner »

Gez wrote:No love for FraggleScript?
I can't think of a single mod that uses it. :(
User avatar
esselfortium
Posts: 3862
Joined: Tue Sep 19, 2006 8:43 pm
Contact:

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

Post 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
User avatar
Minigunner
Posts: 754
Joined: Mon Dec 28, 2009 5:13 pm

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

Post 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:
Gez
 
 
Posts: 17833
Joined: Fri Jul 06, 2007 3:22 pm

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

Post 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.
User avatar
esselfortium
Posts: 3862
Joined: Tue Sep 19, 2006 8:43 pm
Contact:

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

Post 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. :?
User avatar
phi108
Posts: 976
Joined: Sat Dec 01, 2007 6:28 pm

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

Post 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.
User avatar
Minigunner
Posts: 754
Joined: Mon Dec 28, 2009 5:13 pm

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

Post 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.
User avatar
NeuralStunner
 
 
Posts: 12325
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

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

Post 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).
User avatar
Amuscaria
Posts: 6628
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

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

Post by Amuscaria »

Didn't Quake have Dynamic lights in software mode? O_o I'd imagine it would be possible?
User avatar
InsanityBringer
Posts: 3386
Joined: Thu Jul 05, 2007 4:53 pm
Location: opening the forbidden box

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

Post by InsanityBringer »

Quake's software renderer was also much different than doom's.
Post Reply

Return to “General”