SOLREIGN//DEV BLOG
Dev Blog #02

The Quarterly Earnings Call Turned My Whole Screen Green

·The person building SOLREIGN

STATION DIRECTIVE /// DEVLOG BRIEFCLEARANCE: PERSONNEL
A pulsing 30-pixel border became a wall-to-wall acid-green flash. The hunt, the undefined behavior at the bottom of it, and what it teaches about how RobustToolbox compiles your shaders.
State inspector

Screen-border comparison

Screen-border state

Intended border

Interior: transparent

The repair initializes COLOR to transparent before the border branch; unshaded rendering is a separate correctness choice.

The border remains local to its card: its interior is transparent when intended or fixed, and undefined in the broken branch.

xyhur (a name the Season Ledger will remember) reported that the Corporate Ladder's Quarterly Earnings Call turned the whole screen acid green. It should have been only a thin pulsing edge border; instead it filled the screen, faded, and let the shift continue. The code had been wrong from the day it was written, and nothing had ever actually run it.

What was supposed to happen

SOLREIGN has a shared screen-effect channel: station events raise one network event, the client adds an overlay, and the overlay drives acid_screen_border.swsl. The shader finds each pixel's distance to the nearest edge. Inside the 30-pixel border from the prototype YAML, it paints acid green with a fading, sine-pulsed alpha; farther in, it should be transparent.

The earnings call is one of six callers: solar flares, the opening sting of an acid storm, station directives, and ceremonial moments use the same channel, overlay, shader, and border.

The hunt

The first theory was an oversized border. It could not be: all six call sites share one shader prototype with fixed borderSize: 30.0. Duration is the only per-caller knob, and it is clamped at construction. No caller was wrong; the shared mechanism was broken for all six.

That matters because a 600-pixel border on a 1080-pixel-tall screen would make “border” and “whole screen” the same thing. This was not that category of mistake. The value was fixed, the callers were within their contract, and the rendering path itself was responsible.

The root cause

For RobustToolbox users, an .swsl file is not a complete shader. The engine compiles fragment() into a template selected by the file's preset declaration. light_mode unshaded; or preset raw; selects a specialized template; neither declaration silently selects ShaderPreset.Default, or base-default.frag.

That template declares an uninitialized lowp vec4 COLOR;. It samples the light map into LIGHT—live world lighting unless the shader is unshaded, when the engine neutralizes it to vec4(1.0) by passing a negative vertex modulate and decoding MODULATE = -1.0 - VtxModulate. Its final line unconditionally writes COLOR MODULATE LIGHT to gl_FragColor, for every fragment. fragment() therefore has to assign COLOR on every path.

The template makes no exception for a branch that a shader author intended to mean “do nothing.” It will still multiply and write the local. In this case, the shader author had treated the interior as implicitly transparent, while the default template treated it as a value it was entitled to consume.

Our shader assigned COLOR only inside the border check. At 1920x1080 with a 30-pixel border, more than 90% of pixels took the other path and fed an uninitialized local into the final multiply: undefined GLSL behavior. On xyhur's hardware, the result was non-zero and green-tinted. Because the shader was not unshaded, live LIGHT, not vec4(1.0), modulated that garbage. The border was not too large; the transparent interior was rendering noise.

GLSL does not promise what an uninitialized local reads as. One driver may happen to read zero; another may read garbage. That is why this hid until a live player reached this code path, and why the result can look contingent even though the defect is present on every platform.

Why nothing ever caught it

The shader came from upstream's colored_screen_border.swsl, backing ColoredScreenBorderOverlay, which has the same defect: no light mode and COLOR assigned only inside its conditional. That overlay is dead code—it is never added to a viewport—so the Quarterly Earnings Call appears to be the first live caller in the lineage. The legitimate full-screen shaders—nightvision, hologram, stealth, and cooldown—declare light_mode unshaded; and assign COLOR unconditionally. Upstream origin is not proof of a live path; “it came from upstream” and “it has been battle-tested” are different claims.

The fix

The fix is the first line of fragment(): COLOR = vec4(0.0);. It is explicit and unconditional: transparent until the border check proves otherwise, and transparent zero remains transparent under any MODULATE and LIGHT. That removes the undefined read.

The shader also now declares light_mode unshaded;. A screen-edge accent is UI-adjacent, not a lit sprite. This is correctness beside the fix, not the fix itself: unshaded alone leaves an uninitialized read broken.

The distinction is important. COLOR = vec4(0.0) removes the undefined-behavior read on every driver. unshaded then says the effect should not change because the player is standing in a dark corridor. One is the fix; the other keeps the visual role honest.

Two backstops follow:

The clamp is a backstop, not another diagnosis of this incident. It prevents a future prototype, re-theme, or caller from turning an edge treatment into broad screen coverage. Likewise, reduced motion is an accessibility exemption for a pulsing flash; it does not change the cause of the green interior.

What it teaches

For SS14 shaders: no preset declaration silently gets base-default.frag, which does not initialize COLOR, so assign COLOR on every path—first line if possible. Screen-space overlays usually want light_mode unshaded;, or UI inherits mood lighting. Grep for shaders that have neither a light mode nor unconditional COLOR assignment; that combination fails when a live caller finally reaches it. The useful check is not whether a shader file exists or resembles upstream; it is whether a live caller exercises every branch the template will consume.

PROVIDENCE has logged the incident, and the Ledger credits xyhur. If your screen does something it should not, report it: a live report is how this dormant lineage finally met hardware that exposed it. The next Quarterly Earnings Call will pulse at the edges of your screen, where it belongs. Attendance remains mandatory.

See you on shift.

Station Boarding Advisory

Ready to step onto SOLREIGN?

SOLREIGN is an independent, persistent Space Station 14 server. Every other station forgets you at round end — this one keeps a file. Free to join, airlock open.

← All Dev Blog entriesHow to Join →