by Revanic » Sun Feb 08, 2015 12:15 pm
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.
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).
[b]Method 1[/b]
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.
[s][b]Method 2[/b]
More correct (but not totally), and [i]possibly[/i] 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 [i]player's view[/i], 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.[/s]
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 [b]Method 1[/b].
Just an idea. I may try coding either of these myself if I can get the source to compile.