Page 1 of 1

Strange dynamic light behaviour

Posted: Sat Oct 29, 2016 10:48
by Dani75Hun
Hello,

I noticed that dynamic lights in the dev builds are behaving slightly different than the 2.2.0 version. As you can see in the dev build the dynamic light is more intense on the ground, even though it's on the wall (same thing vice versa). It works fine with the official build. While in general this isn't very noticable, it is when you play with a flashlight mod for example.

Dev build (2.3 176, same thing with 232)
Image

2.2.0
Image

Re: Strange dynamic light behaviour

Posted: Sat Oct 29, 2016 12:01
by Edward-san
What's the mod which shows the bug?

Re: Strange dynamic light behaviour

Posted: Sat Oct 29, 2016 13:25
by _mental_
This issue seems to reproducible with any dynamic light source, like this one for example.

EDIT: It started with this commit and the next one didn't fix it.

Re: Strange dynamic light behaviour

Posted: Sat Oct 29, 2016 14:32
by Graf Zahl
Not surprising. This mod is implementing the flash light in an absolutely bad manner that just doesn't work with proper light attenuation. It fires a hitscan and then places an actor with an attached dynamic light close to the wall. I really don't know if I should compromise the system for something this poorly done.

Re: Strange dynamic light behaviour

Posted: Sat Oct 29, 2016 14:40
by Rachael
That's nothing new. That's a technique old late 90's shooters used for flashlights; Half-Life (GoldSrc version) and Unreal included.

Re: Strange dynamic light behaviour

Posted: Sun Oct 30, 2016 7:32
by Dani75Hun
Alright, thanks for the explanation. Since it's a cheap method I guess there's nothing I could do with it, so I just delete it from my mod.

Re: Strange dynamic light behaviour

Posted: Sun Oct 30, 2016 11:47
by Nash
This was one of the first things I noticed with the new physically correct lights and I agree 100% with Graf Zahl:

It is a shit way to do flashlights. :mrgreen:

(I do it this way for my mod too so don't take offense. Realizing now that it's a bad idea that just won't work with the attenuated lights)

The only proper way to do flashlights in games in 2016 is directional spotlights...

Re: Strange dynamic light behaviour

Posted: Sun Oct 30, 2016 12:35
by Blue Shadow
So, attaching a dynamic light to a puff is considered bad now?

Re: Strange dynamic light behaviour

Posted: Sun Oct 30, 2016 13:24
by Graf Zahl
The puff itself will cause proper lighting but let's not forget: The puff is the source of the light, not the flashlight the player holds and with proper light calculations that looks odd.

Re: Strange dynamic light behaviour

Posted: Sun Oct 30, 2016 13:34
by Rachael
To be fair, the hitscan-point method of the flashlight was likely developed before the proper attenuation methods became widespread. However, Unreal has always used attenuation calculations and it still used that method. My guess is, it made the hitscan target object big enough that it backed out from the wall a bit so that it would look less odd.

Re: Strange dynamic light behaviour

Posted: Mon Oct 31, 2016 0:42
by Blue Shadow
Nevermind the flashlight. The problem is that this change affects puffs spawned by hitscan attacks in general. Here is a weapon that is not a flashlight: Skulltag's BFG10K. It's a hitscan weapon, with its puff having a dynamic light attached to it.

(Upper is from 2.2.0; lower is from 2.3pre-222-g6a6263a)

Image

Re: Strange dynamic light behaviour

Posted: Mon Oct 31, 2016 9:26
by Graf Zahl
Hm, ok. I think I'll handle the light attenuation differently then, it looks like far too many mods depend on it being off.

I believe under these circumstances the best solution is to

- add an explicit flag even for attached lights
- add a global MAPINFO option so mods can enable attenuation globally if they want to and
- add a user switch that can enable and disable it globally.

Of course any light explicitly being set to either be attenuated or not attenuated will never be subject to any of these global settings.

The main issue here is that the engine doesn't know any concept on the light source's size. It's just an infinitely small point. Normally, anything within the actual light source should always be fullbright with the brightness falloff only starting with larger distances.If it was implemented like that, attenuation could work globally.

Re: Strange dynamic light behaviour

Posted: Tue Dec 06, 2016 18:40
by Graf Zahl
I have reset the default to the old method. I'll do attenuated lights as an option only because it'd break too many existing mods.

Re: Strange dynamic light behaviour

Posted: Wed Dec 07, 2016 23:18
by Graf Zahl
This has been addressed to make light attenuation opt-in, so default will be the established behavior.