[GZDOOM] Advanced dynamic light manipulation

Archive of the old editing forum
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.
User avatar
Virgil
Posts: 154
Joined: Sun Sep 28, 2003 10:01 pm

[GZDOOM] Advanced dynamic light manipulation

Post 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?
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] Advanced dynamic light manipulation

Post by Graf Zahl »

The dynamic lights are just normal actors so all of these can be done.
User avatar
Virgil
Posts: 154
Joined: Sun Sep 28, 2003 10:01 pm

Re: [GZDOOM] Advanced dynamic light manipulation

Post 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...
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] Advanced dynamic light manipulation

Post by Graf Zahl »

Well, probably not everything. The biggest problem right now is that dynamic light have a rather high performance impact.
User avatar
Virgil
Posts: 154
Joined: Sun Sep 28, 2003 10:01 pm

Re: [GZDOOM] Advanced dynamic light manipulation

Post 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.
User avatar
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

Post by Cutmanmike »

Try it? Make a quick map with a bunch of lights everywhere and see for yourself :wink:
User avatar
phi108
Posts: 976
Joined: Sat Dec 01, 2007 6:28 pm

Re: [GZDOOM] Advanced dynamic light manipulation

Post 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.
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] Advanced dynamic light manipulation

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

Re: [GZDOOM] Advanced dynamic light manipulation

Post 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...
User avatar
Virgil
Posts: 154
Joined: Sun Sep 28, 2003 10:01 pm

Re: [GZDOOM] Advanced dynamic light manipulation

Post 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?
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Re: [GZDOOM] Advanced dynamic light manipulation

Post 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.
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: [GZDOOM] Advanced dynamic light manipulation

Post 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
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] Advanced dynamic light manipulation

Post 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.
User avatar
Virgil
Posts: 154
Joined: Sun Sep 28, 2003 10:01 pm

Re: [GZDOOM] Advanced dynamic light manipulation

Post 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.
User avatar
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

Post 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.
Locked

Return to “Editing (Archive)”