crt_scanlines
A CRT line texture over the finished frame — the demo opener's grain.
crt_scanlines
A CRT line texture over the finished frame — the demo opener's grain.
Every period framebuffer rows, thickness of them are darkened by strength.
Because it reads frag_coord, the line pitch follows the real output resolution
rather than any layout unit, so it looks the same whatever the frame is rendered
at.
| property | default | what it does |
|---|---|---|
period | 6 | rows between one line and the next |
thickness | 2 | rows darkened out of each period |
strength | 0.30 | how far those rows are darkened, 0–1 |
Why it is a shader
The opener is a zui screen whose whole tree is rebuilt every frame. Drawn in
that tree, this texture was one absolutely-positioned box per line — 240 nodes
built, laid out and drawn every frame, which measured about half the sequence's
frame cost. As a full-screen pass it costs one draw and touches no nodes.
Using it
preseed/parts/p_coldstart installs it on enter and removes it on exit:
local shader = asset.resolve("crt_scanlines", "shader")
tools.use("pp", "add", "crt_scanlines", { shader = shader, priority = 100 })
Scoped to this part · feeds back into the world's score.