View Issue Details

IDProjectCategoryView StatusLast Update
0003840The Dark ModCodingpublic31.08.2022 14:50
ReporterSpringheel Assigned Touser81 
PrioritynormalSeveritynormalReproducibilityalways
Status closedResolutionfixed 
Fixed in VersionTDM 2.07 
Summary0003840: Shadow transition lags on movable light entities
DescriptionWhen you turn off a movable lantern or extinguish a candle, the entity switches from nonshadowcasting to casting a shadow. However this happens several frames after the light is extinguished. The adding of projected shadows has made this more obvious.
TagsNo tags attached.

Relationships

related to 0003826 new shadows blink briefly when torch turns on 
related to 0006088 resolvedstgatilov Quickloading from bright area to dark area, the player is fully lit for a few frames 

Activities

tels

tels

06.09.2014 13:24

reporter   ~0006943

The delay is nec. to prevent artefacts.

The light is not flipped off, but faded out, and during that time it still casts shadows, which get increasingly less strong until the light is really off.

If the shadow is turned on in the same frame the light is extinguished, then the light will still casting a shadow from the holder for a few frames, which creates a noticable "blink" of the light holder shadow.
tels

tels

06.09.2014 13:36

reporter   ~0006944

Addendum:

The delay between switching the light source and the shadow shouldn't be longer than it takes the light to fade, but also not shorter (or the shadow flickers briefly).

For the hard shadows themselves there is not much that can be done, as shadows are binary - either on or off.

If the projected shadow is a blend light, tho, then this light could be faded in/out instead of just being flipped on or off. That would hide the transition between the states.
Springheel

Springheel

06.09.2014 17:32

administrator   ~0006945

Last edited: 06.09.2014 21:13

The projected shadows should probably operate the same as the light itself.

tels

tels

05.10.2014 11:16

reporter   ~0007054

There are only two delays in tdm_lights.script - one for torches (500ms) and one for electric lights (50ms).

If you see the issue primarily with moveable candles, maybe these just need their own delay, like 250 ms?

If you play around with these constants in tdm_lights.script, it might be apparent what works better:

// When a shadow is switched on/off, this delays the switch by so many ms:
#define SHADOW_SWITCH_DELAY_TORCH 500
#define SHADOW_SWITCH_DELAY_ELECTRIC 50

There is also the issue that there is only one delay for turning on the light and for turning it off. It might be that one case needs a longer/shorter delay to look better.

The real solution would be to figure out how long the light actually fades in/out and then to use that delay * 0.9 for the shadow transition. But this is complicated, as the light holder would need to figure this out for all attached flames/lights.

user81

28.03.2018 16:00

  ~0010312

I believe this has been fixed, will check and close.

user81

22.12.2018 09:56

  ~0011026

This was fixed a long while ago.

Issue History

Date Modified Username Field Change
05.09.2014 00:57 Springheel New Issue
06.09.2014 13:24 tels Note Added: 0006943
06.09.2014 13:36 tels Note Added: 0006944
06.09.2014 17:32 Springheel Note Added: 0006945
06.09.2014 21:13 Springheel Note Edited: 0006945
05.10.2014 11:06 tels Relationship added related to 0003826
05.10.2014 11:16 tels Note Added: 0007054
28.03.2018 15:59 user81 Assigned To => user81
28.03.2018 15:59 user81 Status new => assigned
28.03.2018 16:00 user81 Note Added: 0010312
22.12.2018 09:56 user81 Note Added: 0011026
22.12.2018 09:56 user81 Status assigned => closed
22.12.2018 09:56 user81 Resolution open => fixed
22.12.2018 09:56 user81 Fixed in Version => TDM 2.07
31.08.2022 14:50 nbohr1more Relationship added related to 0006088