Skip to content

FlickerMapLightUpdater

14.13

Inheritance 1 ancestor · 3 siblings

Class Documentation

Edit documentation

A light updater that makes a light flicker: it scales the colour of the light by a changing factor and moves the light by a small random offset. It works on point lights and on spotlights.

The updater keeps a separate state for each light, created the first time it updates that light. It advances only after at least 1/60 second has passed since its last step. The state cycles through three phases:

Phase Behaviour
Flicker The scale moves along a sine wave between a low and a high value.
Sleep No flicker cycle runs.
Transition The scale blends linearly, over TransitionDuration seconds.

Flicker. Each cycle picks new values:

  • the low value is MinFlickerIntensity plus a random amount up to FlickerIntensityVariance;
  • the high value is MaxFlickerIntensity minus a random amount up to FlickerIntensityVariance;
  • the cycle length is a random time between MinFlickerCycleDuration and MaxFlickerCycleDuration;
  • the position offset is a random value between -TranslationRange and TranslationRange on each axis.

After a random number of cycles between MinFlickerCyclesBeforeSleep and MaxFlickerCyclesBeforeSleep, the light sleeps for a random time between MinSleepDuration and MaxSleepDuration. During sleep the position offset follows a noise value multiplied by TranslationRange.

On every step the updater also adds a random amount between -RandomVariance and RandomVariance to the scale. The client multiplies the colour of the light by the scale and adds the offset to its position.

Properties

FlickerIntensityVariance

F32 = 0.004999999888241291
Edit documentation

Largest random amount that each cycle moves the low and the high value towards each other.

MaxFlickerCycleDuration

F32 = 0.4000000059604645
Edit documentation

Longest flicker cycle, in seconds.

MaxFlickerCyclesBeforeSleep

U8 = 4
Edit documentation

Largest number of flicker cycles before the light sleeps.

MaxFlickerIntensity

F32 = 1.0499999523162842
Edit documentation

Base of the high value of the scale in a flicker cycle.

MaxScaleChange

F32 = 1.0099999904632568
Removed in 14.14
Add documentation

No documentation available yet. Click "Add documentation" to contribute!

MinFlickerCycleDuration

F32 = 0.20000000298023224
Edit documentation

Shortest flicker cycle, in seconds.

MinFlickerCyclesBeforeSleep

U8 = 1
Edit documentation

Smallest number of flicker cycles before the light sleeps.

MinFlickerIntensity

F32 = 0.949999988079071
Edit documentation

Base of the low value of the scale in a flicker cycle.

MinScaleChange

F32 = 0.9900000095367432
Removed in 14.14
Add documentation

No documentation available yet. Click "Add documentation" to contribute!

MinSleepDuration

F32 = 0.20000000298023224
Edit documentation

Shortest sleep, in seconds.

RandomVariance

F32 = 0.009999999776482582
Edit documentation

Amplitude of the noise that the updater adds to the scale on every step.

TransitionDuration

F32 = 0.30000001192092896
14.14
Edit documentation

Length of the transition phase, in seconds.

TranslationRange

Vec3 = [10, 10, 10]
Edit documentation

Largest position offset on each axis, in world units. (0, 0, 0) keeps the light in place.