Bridge: frame coalescing -- the view can no longer fall behind real time

The main loop rendered EVERY draw_scene in arrival order, so any render
slowdown played the mission slower than real time and the view drifted
seconds behind the game (user: "renderer fell way out of sync"); the
backpressure hides in the socket, so backlog= stayed 0. Now each pass
slices all complete records, applies every state record in order, and
presents only the newest frame; superseded presents are counted in the
new skipped= report field. Live verdict over a full mission:
frames=10169 skipped=3 backlog=0B -- locked to the wire.

Also from the tuner session: seat trim granularity 0.1 (0.5 was too
jumpy) and a HUD size trim (vrview_gl u_scale + VRVIEW_HUDSCALE env,
live +/- keys) -- tuners stay enabled for pilot feedback; seat trim
turns out to be per-mech (Mad Cat vs Thor want different values).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-09 00:13:11 -05:00
co-authored by Claude Fable 5
parent 2233441812
commit 1b041d5a9e
2 changed files with 67 additions and 24 deletions
+7 -1
View File
@@ -201,6 +201,7 @@ void main() { // Division DAC gamma, once over the final image
HUD_VS = """
#version 330
uniform vec4 u_rect; // view rect x0 y0 x1 y1 (dpl2d coordinate space)
uniform float u_scale; // HUD size trim (VRVIEW_HUDSCALE / live +/- keys)
in vec2 in_pos;
void main() {
vec2 p = vec2((in_pos.x - u_rect.x) / (u_rect.z - u_rect.x),
@@ -209,10 +210,14 @@ void main() {
// twist dial UNDER the reticle and the range bar filling top-to-bottom;
// mapping straight onto GL's Y-up NDC rendered the whole HUD flipped.
p.y = -p.y;
gl_Position = vec4(p, 0.0, 1.0);
gl_Position = vec4(p * u_scale, 0.0, 1.0);
}
"""
# HUD size trim, live-adjustable from the bridge (+/- keys); pin with
# VRVIEW_HUDSCALE once the right size is found vs period footage.
HUDSCALE = [float(os.environ.get('VRVIEW_HUDSCALE', '1.0'))]
HUD_FS = """
#version 330
uniform vec3 u_col;
@@ -566,6 +571,7 @@ class GLRenderer(vrview.Renderer):
self._set(self._hud_prog, 'u_rect',
(float(vp['x0']), float(vp['y0']),
float(vp['x1']), float(vp['y1'])))
self._set(self._hud_prog, 'u_scale', float(HUDSCALE[0]))
MODES = {'strip': mgl.LINE_STRIP, 'segs': mgl.LINES,
'poly': mgl.TRIANGLE_FAN, 'points': mgl.POINTS}
for kind, col, wd, pts in prims: