Strange dynamic light behaviour

Bugs that have been resolved.

Moderator: Graf Zahl

Locked
Dani75Hun
Posts: 2
Joined: Fri Oct 28, 2016 17:43

Strange dynamic light behaviour

Post 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
Edward-san
Developer
Developer
Posts: 197
Joined: Sun Nov 29, 2009 16:36

Re: Strange dynamic light behaviour

Post by Edward-san »

What's the mod which shows the bug?
_mental_
Developer
Developer
Posts: 259
Joined: Sun Aug 07, 2011 13:36

Re: Strange dynamic light behaviour

Post 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.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Strange dynamic light behaviour

Post 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.
User avatar
Rachael
Developer
Developer
Posts: 3640
Joined: Sat May 13, 2006 10:30

Re: Strange dynamic light behaviour

Post 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.
Dani75Hun
Posts: 2
Joined: Fri Oct 28, 2016 17:43

Re: Strange dynamic light behaviour

Post 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.
User avatar
Nash
Developer
Developer
Posts: 1226
Joined: Sun Sep 25, 2005 1:49
Location: Kuala Lumpur, Malaysia
Contact:

Re: Strange dynamic light behaviour

Post 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...
Blue Shadow
Global Moderator
Global Moderator
Posts: 308
Joined: Sun Aug 29, 2010 6:09

Re: Strange dynamic light behaviour

Post by Blue Shadow »

So, attaching a dynamic light to a puff is considered bad now?
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Strange dynamic light behaviour

Post 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.
User avatar
Rachael
Developer
Developer
Posts: 3640
Joined: Sat May 13, 2006 10:30

Re: Strange dynamic light behaviour

Post 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.
Blue Shadow
Global Moderator
Global Moderator
Posts: 308
Joined: Sun Aug 29, 2010 6:09

Re: Strange dynamic light behaviour

Post 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
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Strange dynamic light behaviour

Post 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.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Strange dynamic light behaviour

Post 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.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Strange dynamic light behaviour

Post by Graf Zahl »

This has been addressed to make light attenuation opt-in, so default will be the established behavior.
Locked

Return to “Closed Bugs”