const REC_DOT: &str = r#"
float fx_rect(vec2 q, vec2 c, vec2 h) {
vec2 d = abs(q - c) - h;
return max(d.x, d.y) < 0.0 ? 1.0 : 0.0;
}
float fx_digit(vec2 q, int d) {
if (q.x < 0.0 || q.x > 1.0 || q.y < 0.0 || q.y > 1.0) return 0.0;
int seg[10] = int[10](63, 6, 91, 79, 102, 109, 125, 7, 127, 111);
int m = seg[clamp(d, 0, 9)];
float t = 0.11;
float o = 0.0;
if ((m & 1) != 0) o = max(o, fx_rect(q, vec2(0.5, t), vec2(0.5 - t, t)));
if ((m & 2) != 0) o = max(o, fx_rect(q, vec2(1.0 - t, 0.25), vec2(t, 0.25 - t)));
if ((m & 4) != 0) o = max(o, fx_rect(q, vec2(1.0 - t, 0.75), vec2(t, 0.25 - t)));
if ((m & 8) != 0) o = max(o, fx_rect(q, vec2(0.5, 1.0 - t), vec2(0.5 - t, t)));
if ((m & 16) != 0) o = max(o, fx_rect(q, vec2(t, 0.75), vec2(t, 0.25 - t)));
if ((m & 32) != 0) o = max(o, fx_rect(q, vec2(t, 0.25), vec2(t, 0.25 - t)));
if ((m & 64) != 0) o = max(o, fx_rect(q, vec2(0.5, 0.5), vec2(0.5 - t, t)));
return o;
}
void main() {
vec2 uv = gl_FragCoord.xy / u_res;
vec4 src = texture(tex, uv);
vec2 q = gl_FragCoord.xy;
float sc = max(u_scale, 0.05);
float sz = max(p0, 2.0) * sc;
float mg = max(p4, 0.0) * sc;
int corner = int(clamp(p2, 0.0, 3.0) + 0.5);
bool right = (corner == 1 || corner == 3);
bool bottom = (corner == 2 || corner == 3);
vec2 anchor = vec2(right ? u_res.x - mg - sz * 0.5 : mg + sz * 0.5,
bottom ? u_res.y - mg - sz * 0.5 : mg + sz * 0.5);
float hz = max(p1, 0.0);
float on = hz <= 0.0 ? 1.0 : (fract(u_time * hz) < 0.5 ? 1.0 : 0.0);
float dot_ = 1.0 - smoothstep(sz * 0.5 - 1.0, sz * 0.5 + 1.0, distance(q, anchor));
vec3 c = mix(src.rgb, vec3(0.9, 0.12, 0.12), dot_ * on);
float cover = dot_ * on;
if (p3 >= 0.5) {
float dh = sz;
float dw = sz * 0.55;
float gap = sz * 0.12;
float cw = dw + gap;
float colw = sz * 0.3 + gap;
float total = 6.0 * cw + 2.0 * colw;
float ox = right ? anchor.x - sz * 0.5 - gap * 2.0 - total : anchor.x + sz * 0.5 + gap * 2.0;
float oy = anchor.y - dh * 0.5;
int tot = int(max(u_time, 0.0));
int hh = (tot / 3600) - (tot / 360000) * 100;
int mm = (tot / 60) - (tot / 3600) * 60;
int ss = tot - (tot / 60) * 60;
int digs[6] = int[6](hh / 10, hh - (hh / 10) * 10, mm / 10, mm - (mm / 10) * 10,
ss / 10, ss - (ss / 10) * 10);
float ink = 0.0;
float x = ox;
for (int i = 0; i < 6; i++) {
ink = max(ink, fx_digit(vec2((q.x - x) / dw, (q.y - oy) / dh), digs[i]));
x += cw;
if (i == 1 || i == 3) {
float cx = x + colw * 0.5;
ink = max(ink, fx_rect(q, vec2(cx, oy + dh * 0.33), vec2(sz * 0.07)));
ink = max(ink, fx_rect(q, vec2(cx, oy + dh * 0.7), vec2(sz * 0.07)));
x += colw;
}
}
c = mix(c, vec3(1.0), ink * 0.9);
cover = max(cover, ink * 0.9);
}
vec4 res = vec4(c, max(src.a, cover));
float m = u_has_mask > 0.5 ? texture(u_mask, uv).r : 1.0;
out_color = mix(src, res, m);
}
"#;Expand description
Blinking record dot in a corner (p2: 0 = top-left, 1 = top-right, 2 = bottom-left, 3 = bottom-right) plus an optional HH:MM:SS timecode drawn as seven-segment quads from the clip-local time.