Extend jitter to cover the full glitch window, not just a short burst

GLITCH_ACTIVE_SECONDS was still capped at 6s from when this Sequence
also drove the (since-removed) hue-shifted RGB-split bands, which were
expensive enough that sizing against the full 22s show_static window
pushed a render past the 460KB limit. render.Sequence doesn't loop on
its own, so once those 6s of ticks were exhausted the jitter sequence
just stopped painting -- scanlines and corner ticks (not Sequence-based)
kept going, making it look like jitter had stopped working entirely
once past that opening burst, which is what was being seen.

Now that the jitter alone drives this (bands are gone, shift mechanism
is _glitch_shift/Padding), it compresses far better: measured ~82KB
typical and worst-case even sized against the full
STATIC_OVERLAY_END_SECONDS (22s) window, so there's no longer a reason
to cap it short. Re-verified 0 black-corner hits across 199 frames.
This commit is contained in:
poprhythm committed 2026-10-09 16:24:15 -04:00
1 parent 7d748361ab
commit 25c41fb6b2
1 file changed
+17 -12
+17 -12
View File
@@ -411,19 +411,24 @@ GLITCH_STATE_POOL = [
# render.Sequence doesn't loop on its own (see _glitch_scanlines below), so
# to repeat the burst-then-pause pattern, the repeats have to be spelled
# out as one long children list up front rather than relying on any
# runtime looping.
# runtime looping. That matters here: with GLITCH_ACTIVE_SECONDS shorter
# than the actual show_static window, the sequence simply ran out and
# stopped painting partway through -- jitter played once near the start
# of the window and then silently went quiet for the rest of it, while
# the scanlines/corner ticks (which aren't Sequence-based) kept going,
# making it look like jitter wasn't working at all once past that
# opening burst.
#
# Deliberately *not* sized against the full show_static window (which can
# now be up to STATIC_OVERLAY_END_SECONDS = 22s): each repeat adds several
# more uniquely-tinted/shifted frames for WebP to encode, and scaling that
# up to cover 22s of jitter pushed a real render past the 460KB device
# limit (measured 481KB). Scanlines and corner ticks (see _glitch_effect)
# are cheap, constant per-pixel layers that can cover the full window for
# free, but the hue-shifted bands don't need to keep jittering the whole
# time to read as "something's happening" -- GLITCH_ACTIVE_SECONDS caps
# how much of the window actually gets jitter, independent of how long
# the window itself is.
GLITCH_ACTIVE_SECONDS = 6
# An earlier version capped this well below the full show_static window
# (which can be up to STATIC_OVERLAY_END_SECONDS = 22s) because the
# hue-shifted RGB-split bands this used to also drive were expensive
# enough to push a real render past the 460KB device limit if sized
# against the full window (measured 481KB at the time). Those bands are
# gone now -- this only drives the base-art jitter, built on
# render.Sequence + _glitch_shift (Padding), which compresses far
# better: a real worst-case render at the *full* 22s now measures ~54KB.
# So this now covers the whole window instead of a short burst within it.
GLITCH_ACTIVE_SECONDS = STATIC_OVERLAY_END_SECONDS
_GLITCH_CYCLE_TICKS = GLITCH_STATES_PER_CYCLE * GLITCH_HOLD_TICKS + GLITCH_PAUSE_TICKS
_GLITCH_TICKS_PER_SECOND = 20 # 1000ms / 50ms-per-tick
GLITCH_REPEATS = int(GLITCH_ACTIVE_SECONDS * _GLITCH_TICKS_PER_SECOND / _GLITCH_CYCLE_TICKS) + 1
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.