RiftFlicker
RiftFlicker drives a Light's intensity so it breathes, flickers and surges with the arcane rift. It sits on an entity with a `Light` component and sets that light's `intensity` every frame. It is a local-only visual: its fields are `NoSync`, and every peer runs its own flicker.
RiftFlicker
RiftFlicker drives a Light's intensity so it breathes, flickers and surges with the arcane rift. It
sits on an entity with a Light component and sets that light's intensity every frame. It is a
local-only visual: its fields are NoSync, and every peer runs its own flicker.
The fx_rift scene uses it on four lights. rift_heart_light runs the defaults. rift_rim_light_1,
rift_rim_light_2 and rift_rim_light_3 run base = 9, breathe = 0.05, flicker = 0.3,
flickerRate = 17, surge = 0.4 and surgeRate = 3.3, with phases 0.37, 0.74 and 1.11 so they
pulse out of step.
It runs at executionOrder = 0.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
base | number | 18 | Intensity the light sits around, in the Light component's units. |
breathe | number | 0.1 | Share of base the slow breathing swings by. |
flicker | number | 0.15 | Share of base the fast noise flicker swings by. |
flickerRate | number | 11 | How fast the flicker noise changes, in cycles per second. |
surge | number | 0.45 | Share of base a surge adds at its peak. |
surgeRate | number | 2.1 | Angular rate of the surge cycle, in radians per second (matches the spark bursts). |
phase | number | 0 | Offset into the cycle, in seconds, so several lights do not pulse in lockstep. |
How the intensity is computed
With t the component's own running clock plus phase:
s = max(0, sin(t * surgeRate))
k = 0.78 + breathe * sin(t * 1.7)
+ flicker * math.noise(t * flickerRate, phase * 3.1)
+ surge * s^12
intensity = base * max(k, 0.2)
Lifecycle
update(dt): advances the clock bydtand sets the light's intensity.editorUpdate(dt): does the same whileengine.pausedis true, so edit-running ticks it once per frame.
Scoped to this part · feeds back into the world's score.