Disable RGB-split bands, re-enable scanlines, fix base jitter cancelling out
Commented out the two _glitch_band calls per request (RGB-split bands off), re-enabled _glitch_scanlines. Also found and fixed a real bug in the base jitter: base_shift was derived by averaging each state's shift1/shift2 values, but several GLITCH_STATE_POOL entries have those nearly or exactly cancel out (e.g. -2 and 2 average to 0), silently zeroing out the jitter in about half the burst states -- likely why it wasn't visible. Now alternates a fixed +1/-1 by position in the sequence instead, so it's never zero.
This commit is contained in:
1 parent
8d9fe63fe4
commit
4983e81a24
1 file changed
+13
-8
+13
-8
@@ -478,18 +478,23 @@ def _glitch_jitter(zoom):
|
|||||||
pause = _glitch_hold(render.Box(width = ART_SLOT, height = ART_SLOT), GLITCH_PAUSE_TICKS)
|
pause = _glitch_hold(render.Box(width = ART_SLOT, height = ART_SLOT), GLITCH_PAUSE_TICKS)
|
||||||
|
|
||||||
sequence = []
|
sequence = []
|
||||||
|
state_index = 0
|
||||||
for cycle_index in range(GLITCH_REPEATS):
|
for cycle_index in range(GLITCH_REPEATS):
|
||||||
for top1, h1, shift1, hue1, top2, h2, shift2, hue2 in _glitch_states_for_cycle(cycle_index):
|
for top1, h1, shift1, hue1, top2, h2, shift2, hue2 in _glitch_states_for_cycle(cycle_index):
|
||||||
# The art itself nudges along with the bands, not just the
|
# The art itself nudges along with the bands, not just the
|
||||||
# bands moving over a static image. Capped to +-1px (rather
|
# bands moving over a static image. Capped to +-1px -- a
|
||||||
# than splitting the difference between the two bands' own,
|
# full-frame shift reads very differently than a thin band
|
||||||
# larger shift values) -- a full-frame shift reads very
|
# shifting, so it stays subtle. Alternates +1/-1 by position
|
||||||
# differently than a thin band shifting, so it stays subtle.
|
# in the sequence rather than deriving from shift1/shift2:
|
||||||
base_shift = max(-1, min(1, int((shift1 + shift2) / 2.0)))
|
# several pool entries have those nearly or exactly
|
||||||
|
# cancel out (e.g. -2 and 2), which silently zeroed out the
|
||||||
|
# jitter in about half the states.
|
||||||
|
base_shift = 1 if state_index % 2 == 0 else -1
|
||||||
|
state_index += 1
|
||||||
state = render.Stack(children = [
|
state = render.Stack(children = [
|
||||||
_glitch_base_jitter(zoom, base_shift),
|
_glitch_base_jitter(zoom, base_shift),
|
||||||
_glitch_band(zoom, top1, h1, shift1, hue1),
|
# _glitch_band(zoom, top1, h1, shift1, hue1),
|
||||||
_glitch_band(zoom, top2, h2, shift2, hue2),
|
# _glitch_band(zoom, top2, h2, shift2, hue2),
|
||||||
])
|
])
|
||||||
sequence.append(_glitch_hold(state, GLITCH_HOLD_TICKS))
|
sequence.append(_glitch_hold(state, GLITCH_HOLD_TICKS))
|
||||||
sequence.append(pause)
|
sequence.append(pause)
|
||||||
@@ -560,7 +565,7 @@ def _glitch_effect(zoom):
|
|||||||
height = ART_SLOT,
|
height = ART_SLOT,
|
||||||
child = render.Stack(children = [
|
child = render.Stack(children = [
|
||||||
_glitch_jitter(zoom),
|
_glitch_jitter(zoom),
|
||||||
# _glitch_scanlines(), # disabled -- was making the jitter hard to see
|
_glitch_scanlines(),
|
||||||
_glitch_corner_ticks("#00000080"),
|
_glitch_corner_ticks("#00000080"),
|
||||||
]),
|
]),
|
||||||
)
|
)
|
||||||
|
|||||||