Page 1 of 2

[GZDOOM] Advanced dynamic light manipulation

Posted: Mon Apr 21, 2008 8:03 pm
by Virgil
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?

Re: [GZDOOM] Advanced dynamic light manipulation

Posted: Tue Apr 22, 2008 12:37 am
by Graf Zahl
The dynamic lights are just normal actors so all of these can be done.

Re: [GZDOOM] Advanced dynamic light manipulation

Posted: Tue Apr 22, 2008 12:44 am
by Virgil
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...

Re: [GZDOOM] Advanced dynamic light manipulation

Posted: Tue Apr 22, 2008 1:28 am
by Graf Zahl
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

Posted: Tue Apr 22, 2008 3:05 am
by Virgil
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.

Re: [GZDOOM] Advanced dynamic light manipulation

Posted: Tue Apr 22, 2008 3:19 am
by Cutmanmike
Try it? Make a quick map with a bunch of lights everywhere and see for yourself :wink:

Re: [GZDOOM] Advanced dynamic light manipulation

Posted: Tue Apr 22, 2008 2:15 pm
by phi108
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.

Re: [GZDOOM] Advanced dynamic light manipulation

Posted: Tue Apr 22, 2008 2:29 pm
by Graf Zahl
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.
That shouldn't be too bad as long as the lights' radius isn't too large.
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

Posted: Tue Apr 22, 2008 2:41 pm
by phi108
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...

Re: [GZDOOM] Advanced dynamic light manipulation

Posted: Tue Apr 22, 2008 2:53 pm
by Virgil
Graf Zahl wrote: That shouldn't be too bad as long as the lights' radius isn't too large.
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?

Re: [GZDOOM] Advanced dynamic light manipulation

Posted: Tue Apr 22, 2008 3:13 pm
by HotWax
Virgil wrote:Does this mean that one 255-radius dynamic light would slow down the game more than 4 64-radius dynamic lights?
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. ;))

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

Posted: Tue Apr 22, 2008 3:20 pm
by Enjay
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

Re: [GZDOOM] Advanced dynamic light manipulation

Posted: Wed Apr 23, 2008 12:30 pm
by Graf Zahl
Virgil wrote:
Graf Zahl wrote: That shouldn't be too bad as long as the lights' radius isn't too large.
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?


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

Posted: Wed Apr 23, 2008 5:25 pm
by Virgil
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.

Re: [GZDOOM] Advanced dynamic light manipulation

Posted: Thu Apr 24, 2008 1:50 am
by Project Shadowcat
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.
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.