Software "Dynamic Lighting"
Moderator: GZDoom Developers
Software "Dynamic Lighting"
I thought of 2 ways to simulate dynamic lights in software mode that shouldn't have much more of an impact on resources/fps as DooM's regular dynamic lighting ( Weapon flash).
Method 1
The easiest of the two.
Essentially just adding the light values to the player's extralight (like weapon light), or something similar, possibly attenuated by distance from the player (because a monster attacking another far away from the player shouldn't just randomly light up all the sectors). You would get the illusion of a dynamic light as the lit object would approach you. May be able to determine attenuation through the defined lights in lights.pk3. I believe a few Build engine games did something like this.
Method 2
More correct (but not totally), and possibly more resource intensive, though I do not know by how much. Should be cheaper than GZDoom's dynamic lights still.
You would treat each light casting thing like how light is treated for the player's view, but disregard all sector lighting (treating it like its all at 0), and then add it on top of the default lighting. This will look pretty good and allow the player to see dynamic lights from anywhere, however the lighting would have no Z attenuation, meaning the floor and ceiling will have the same brightness created around the object regardless of height difference. Would be better than nothing though. Could definitely use the lights from the lights.pk3 in this one.
Edit: Actually the above is wrong. Something similar can be done, but just not the way I suggested it exactly. I guess for now I am only suggesting Method 1.
Just an idea. I may try coding either of these myself if I can get the source to compile.
Method 1
The easiest of the two.
Essentially just adding the light values to the player's extralight (like weapon light), or something similar, possibly attenuated by distance from the player (because a monster attacking another far away from the player shouldn't just randomly light up all the sectors). You would get the illusion of a dynamic light as the lit object would approach you. May be able to determine attenuation through the defined lights in lights.pk3. I believe a few Build engine games did something like this.
Method 2
More correct (but not totally), and possibly more resource intensive, though I do not know by how much. Should be cheaper than GZDoom's dynamic lights still.
You would treat each light casting thing like how light is treated for the player's view, but disregard all sector lighting (treating it like its all at 0), and then add it on top of the default lighting. This will look pretty good and allow the player to see dynamic lights from anywhere, however the lighting would have no Z attenuation, meaning the floor and ceiling will have the same brightness created around the object regardless of height difference. Would be better than nothing though. Could definitely use the lights from the lights.pk3 in this one.
Edit: Actually the above is wrong. Something similar can be done, but just not the way I suggested it exactly. I guess for now I am only suggesting Method 1.
Just an idea. I may try coding either of these myself if I can get the source to compile.
Re: Software "Dynamic Lighting"
If you're thinking of the flare in Blood, it does it by adding extra round, see-through flat sprites to the render list for each flare sprite that was visible from drawrooms and within a certain distance of a floor or ceiling.Revanic wrote:I believe a few Build engine games did something like this.
Re: Software "Dynamic Lighting"
I wouldn't consider method 1 as dynamic lighting since it would be just range for a_light (which on itself isn't a bad idea).
I was thinking about this: The light would be image which would be drawn and the tilted to the floor and walls on top of the scene. (wait, isn't that something like GZDoom?)
Something like this:
(maybe not) possible result: https://www.dropbox.com/s/vqxi53maak1h8 ... A.png?dl=0
Lighting tilted: https://www.dropbox.com/s/z3w4vnf7hgrtb ... B.png?dl=0
Combined picture: https://www.dropbox.com/s/t395uqesgyttv ... C.png?dl=0
But I am not even thinking about dreaming that something like this would even be attempted.
I was thinking about this: The light would be image which would be drawn and the tilted to the floor and walls on top of the scene. (wait, isn't that something like GZDoom?)
Something like this:
(maybe not) possible result: https://www.dropbox.com/s/vqxi53maak1h8 ... A.png?dl=0
Lighting tilted: https://www.dropbox.com/s/z3w4vnf7hgrtb ... B.png?dl=0
Combined picture: https://www.dropbox.com/s/t395uqesgyttv ... C.png?dl=0
But I am not even thinking about dreaming that something like this would even be attempted.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Software "Dynamic Lighting"
That will never work with the 8 bit software renderer simply due to lack of needed colors.
Re: Software "Dynamic Lighting"
If dynamic lights are limited to white light, it could work with an overbright colormap. If I'm not mistaken, Quake used something like that.
All the examples of dynamic light in original software renderers (not advanced ports written over a decade after the game) that I remember were limited to white light.
All the examples of dynamic light in original software renderers (not advanced ports written over a decade after the game) that I remember were limited to white light.
Last edited by Gez on Mon Feb 09, 2015 5:57 pm, edited 1 time in total.
- Hellser
- Global Moderator
- Posts: 2784
- Joined: Sun Jun 25, 2006 4:43 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Manjaro Linux
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
- Location: Citadel Station
Re: Software "Dynamic Lighting"
I am sort of leaning towards the white-light idea as well. How hard would it be to add overbright to ZDoom, I wonder?
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: Software "Dynamic Lighting"
I would love some Quake overbrighting. Too bad >255 sector light already has a "defined" behavior - Not that there couldn't be a new sector flag to enable overbrighting.
You can kind of fake it with sector fades currently, but that's a pain in the arse. (And can't quite work properly with light specials, if you need to transition from overbright to darkened.)
You can kind of fake it with sector fades currently, but that's a pain in the arse. (And can't quite work properly with light specials, if you need to transition from overbright to darkened.)
Re: Software "Dynamic Lighting"
The only thing I am really suggesting here is taking what little "fake" dynamic lighting software mode has and expand upon it in some way. Colored lighting is not necessary for this, nor is overbrightening.
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: Software "Dynamic Lighting"
There isn't any, so there's nothing to expand on.Revanic wrote:The only thing I am really suggesting here is taking what little "fake" dynamic lighting software mode has and expand upon it in some way.
Re: Software "Dynamic Lighting"
Extralight brightens everything. Dynamic lighting as defined in GZDoom consists of localized pointlights that only brighten their surrounding.
Re: Software "Dynamic Lighting"
Then it would work just like quake 2 lights, colored for opengl and white/black for software.Graf Zahl wrote:That will never work with the 8 bit software renderer simply due to lack of needed colors.
IF the lights were fixed sized and would never change, it would be easier, but, it could create a texture buffer just to store the textures of the places with dynamic light, apply that circle sprite as a brightmap and tadah, you got a dynamic light

At least it would be a start for software users Use Gzdoom, give up from zdoom and his pentium mmx render era, come back to the new world and feel the beauty of opengl. Unless you have a pentium mmx with a voodoo
Why can't I use a 50 size font? its the tinny config '-'
- StrikerMan780
- Posts: 486
- Joined: Tue Nov 29, 2005 2:15 pm
- Graphics Processor: nVidia with Vulkan support
- Contact:
Re: Software "Dynamic Lighting"
If this were to be done, the best option would to be to go the way of light sourcing in Rise of the Triad. (Radial, colormap-based lighting.)
It's probably the closest you'd get to the Doom software renderer to compare to.
It's probably the closest you'd get to the Doom software renderer to compare to.