[GZDOOM] Advanced dynamic light manipulation
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
[GZDOOM] Advanced dynamic light manipulation
I wish to know if it is at all possible to remove/spawn/manipulate GZDOOM's dynamic light objects using ACS scripting. Also, I wish to know the depth to which they can be manipulated.
For example, can I use Thing_Remove on thing 9800 ("Point Light") if it has a non-zero TID without breaking the game? Can I use SpawnSpot (or maybe even Thing_Spawn) to spawn it? Can I teleport them around using TeleportOther?
For example, can I use Thing_Remove on thing 9800 ("Point Light") if it has a non-zero TID without breaking the game? Can I use SpawnSpot (or maybe even Thing_Spawn) to spawn it? Can I teleport them around using TeleportOther?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [GZDOOM] Advanced dynamic light manipulation
The dynamic lights are just normal actors so all of these can be done.
Re: [GZDOOM] Advanced dynamic light manipulation
Awesome! I suspected as much, just wanted to be sure. Thanks.
So basically, with some clever manipulation from scripts, dynamic lighting in GZDOOM can accomplish everything modern FPS engines can, save the dynamic shadows...
So basically, with some clever manipulation from scripts, dynamic lighting in GZDOOM can accomplish everything modern FPS engines can, save the dynamic shadows...
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [GZDOOM] Advanced dynamic light manipulation
Well, probably not everything. The biggest problem right now is that dynamic light have a rather high performance impact.
Re: [GZDOOM] Advanced dynamic light manipulation
Are we talking.. "Nuke your duo core 2.0 with 2GB RAM and brand new gfx card"-kind? Or at least the "nuke-most-PC's" kind? I am not planning on having over 20 on screen at the same time, but I am planning on well over 100 different dynamic lights in a map at any given time.
- Cutmanmike
- Posts: 11335
- Joined: Mon Oct 06, 2003 3:41 pm
- Operating System Version (Optional): Windows 10
- Location: United Kingdom
- Contact:
Re: [GZDOOM] Advanced dynamic light manipulation
Try it? Make a quick map with a bunch of lights everywhere and see for yourself
Re: [GZDOOM] Advanced dynamic light manipulation
Dynamic lights GZDoom slow my performance, and also in Halo and Half Life 2. I guess it's the onboard graphics.
You can advise users to force additive lighting, that helps my perfromance.
You can advise users to force additive lighting, that helps my perfromance.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [GZDOOM] Advanced dynamic light manipulation
That shouldn't be too bad as long as the lights' radius isn't too large.Virgil wrote:Are we talking.. "Nuke your duo core 2.0 with 2GB RAM and brand new gfx card"-kind? Or at least the "nuke-most-PC's" kind? I am not planning on having over 20 on screen at the same time, but I am planning on well over 100 different dynamic lights in a map at any given time.
phi108 wrote:Dynamic lights GZDoom slow my performance, and also in Halo and Half Life 2. I guess it's the onboard graphics.
Onboard graphics == teh suck!
Re: [GZDOOM] Advanced dynamic light manipulation
Definitely. I went into Halo's MAP files and set the radius of all the dynamic lights to zero, and now I have very smooth performance.
I wonder if a system of dynamic sectors, with sector lighting gradients simulating dynamic lights, would perform well. I can't really hope for this with the Doom engine, though...
I wonder if a system of dynamic sectors, with sector lighting gradients simulating dynamic lights, would perform well. I can't really hope for this with the Doom engine, though...
Re: [GZDOOM] Advanced dynamic light manipulation
Yeah, I am thinking of having entire rooms be nothing but dynamic light (no more sector-based lighting). Does this mean that one 255-radius dynamic light would slow down the game more than 4 64-radius dynamic lights?Graf Zahl wrote: That shouldn't be too bad as long as the lights' radius isn't too large.
Re: [GZDOOM] Advanced dynamic light manipulation
First off, the math for that doesn't work. If a circle of light has a radius of ~256, it would take 16 64-radius circles to fill the same space, not 4. (Look up basic geometry for why this is. )Virgil wrote:Does this mean that one 255-radius dynamic light would slow down the game more than 4 64-radius dynamic lights?
Second, of course rendering a single light-source would be quicker than rendering 16, or even 4. What Graf was saying was that 100 lights at 64 radius each would of course render faster than 100 lights at 256 radius each. I think you read way too much into his comment.
Re: [GZDOOM] Advanced dynamic light manipulation
A file that DoomerMrT posted a few days ago for the purpose of testing a bug with the sound code has some pretty fine use of dynamic lights. The level is clearly a work in progress, but it's worth looking at to see the lighting effects - and then compare it with the software renderer.
http://rapidshare.com/files/108744086/2 ... t.zip.html
http://rapidshare.com/files/108744086/2 ... t.zip.html
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [GZDOOM] Advanced dynamic light manipulation
Virgil wrote:Yeah, I am thinking of having entire rooms be nothing but dynamic light (no more sector-based lighting). Does this mean that one 255-radius dynamic light would slow down the game more than 4 64-radius dynamic lights?Graf Zahl wrote: That shouldn't be too bad as long as the lights' radius isn't too large.
Large lights simply touch more surfaces. The critical factor is not number of total lights but the sum of the numbers of surfaces each light touches. One surface equals an upper/middle/lower part of a linedef and one subsector's floor/ceiling.
Re: [GZDOOM] Advanced dynamic light manipulation
I see.. So the more surfaces a light illuminates, the more resources that takes to render. Makes sense. Unfortunately, I was planning to have quite a few surfaces per light source. probably one source ulliminating anywhere from 10-100 sectors/lines on average. Either way, I will probably have to push the engine's dynamic light capability to the max (and make PC's explode). Let's face it, extremely detailed old-fashioned sector-based lighting is just not feasible past a certain level of architectural detail...
I mean, if I have 50-100 sectors in, say, a 128*128 grid (yes, that will probably happen sooner or later, and more than once), then I can't even begin to imagine what it would take (if at all possible) to add advanced, irregular-shaped and smooth sector-based lighting to that. And by that I mean at least 32 different light levels, all aligned properly, including, transfer light tricks and illuminating only a certain portion of the walls.
Anyway, thanks for clearing it up Graf.
I mean, if I have 50-100 sectors in, say, a 128*128 grid (yes, that will probably happen sooner or later, and more than once), then I can't even begin to imagine what it would take (if at all possible) to add advanced, irregular-shaped and smooth sector-based lighting to that. And by that I mean at least 32 different light levels, all aligned properly, including, transfer light tricks and illuminating only a certain portion of the walls.
Anyway, thanks for clearing it up Graf.
- Project Shadowcat
- Posts: 9369
- Joined: Thu Jul 14, 2005 8:33 pm
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: Blacksburg, SC USA
- Contact:
Re: [GZDOOM] Advanced dynamic light manipulation
Please don't do that, players like me really don't care for gawdy details. Textures can fake the same work and do just as well for those who are simply going for the gameplay. It also immensely helps in performance.Virgil wrote:I mean, if I have 50-100 sectors in, say, a 128*128 grid (yes, that will probably happen sooner or later, and more than once), then I can't even begin to imagine what it would take (if at all possible) to add advanced, irregular-shaped and smooth sector-based lighting to that. And by that I mean at least 32 different light levels, all aligned properly, including, transfer light tricks and illuminating only a certain portion of the walls.