[GZDOOM] Advanced dynamic light manipulation

Discuss all aspects of editing for ZDoom.
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

[GZDOOM] Advanced dynamic light manipulation

Postby Virgil » Mon Apr 21, 2008 8:03 pm

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
Virgil
 
Joined: 28 Sep 2003

Re: [GZDOOM] Advanced dynamic light manipulation

Postby Graf Zahl » Tue Apr 22, 2008 12:37 am

The dynamic lights are just normal actors so all of these can be done.
User avatar
Graf Zahl
 
Joined: 19 Jul 2003
Location: Germany

Re: [GZDOOM] Advanced dynamic light manipulation

Postby Virgil » Tue Apr 22, 2008 12:44 am

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
Virgil
 
Joined: 28 Sep 2003

Re: [GZDOOM] Advanced dynamic light manipulation

Postby Graf Zahl » Tue Apr 22, 2008 1:28 am

Well, probably not everything. The biggest problem right now is that dynamic light have a rather high performance impact.
User avatar
Graf Zahl
 
Joined: 19 Jul 2003
Location: Germany

Re: [GZDOOM] Advanced dynamic light manipulation

Postby Virgil » Tue Apr 22, 2008 3:05 am

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
Virgil
 
Joined: 28 Sep 2003

Re: [GZDOOM] Advanced dynamic light manipulation

Postby Cutmanmike » Tue Apr 22, 2008 3:19 am

Try it? Make a quick map with a bunch of lights everywhere and see for yourself :wink:
User avatar
Cutmanmike
Not dead
 
Joined: 06 Oct 2003
Location: United Kingdom

Re: [GZDOOM] Advanced dynamic light manipulation

Postby phi108 » Tue Apr 22, 2008 2:15 pm

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
phi108
Magical Error?
 
Joined: 01 Dec 2007

Re: [GZDOOM] Advanced dynamic light manipulation

Postby Graf Zahl » Tue Apr 22, 2008 2:29 pm

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
Graf Zahl
 
Joined: 19 Jul 2003
Location: Germany

Re: [GZDOOM] Advanced dynamic light manipulation

Postby phi108 » Tue Apr 22, 2008 2:41 pm

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
phi108
Magical Error?
 
Joined: 01 Dec 2007

Re: [GZDOOM] Advanced dynamic light manipulation

Postby Virgil » Tue Apr 22, 2008 2:53 pm

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
Virgil
 
Joined: 28 Sep 2003

Re: [GZDOOM] Advanced dynamic light manipulation

Postby HotWax » Tue Apr 22, 2008 3:13 pm

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
HotWax
Do what you must, and pay the price later.
 
Joined: 18 Jul 2003
Location: Idaho Falls, ID

Re: [GZDOOM] Advanced dynamic light manipulation

Postby Enjay » Tue Apr 22, 2008 3:20 pm

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
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
Joined: 15 Jul 2003
Location: Scotland

Re: [GZDOOM] Advanced dynamic light manipulation

Postby Graf Zahl » Wed Apr 23, 2008 12:30 pm

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
Graf Zahl
 
Joined: 19 Jul 2003
Location: Germany

Re: [GZDOOM] Advanced dynamic light manipulation

Postby Virgil » Wed Apr 23, 2008 5:25 pm

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
Virgil
 
Joined: 28 Sep 2003

Re: [GZDOOM] Advanced dynamic light manipulation

Postby Project Dark Fox » Thu Apr 24, 2008 1:50 am

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.
User avatar
Project Dark Fox
Nightmare Fuel Station Attendant
 
Joined: 14 Jul 2005
Location: The Gutter

Next

Return to Editing

Who is online

Users browsing this forum: Bing [Bot] and 7 guests