HUD: dpl2d Y grows down -- unflip the whole 2D layer

Period VHS footage of a 4.10 game (operator's capture) shows the twist
dial UNDER the reticle and the range bar filling top-to-bottom; our
mapping of dpl2d Y straight onto GL's Y-up NDC (and the software path's
"y up" projection) rendered the entire HUD vertically flipped.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-08 19:37:29 -05:00
co-authored by Claude Fable 5
parent c5659b8d3e
commit 7ae11f174c
2 changed files with 7 additions and 1 deletions
+3 -1
View File
@@ -1008,8 +1008,10 @@ class Renderer:
g = 1.0 / self.gamma g = 1.0 / self.gamma
def P(pt): def P(pt):
# dpl2d Y grows DOWN (screen convention; period VHS footage:
# twist dial UNDER the reticle, range bar filling top-to-bottom)
return (int((pt[0] - x0) * sx + 0.5), return (int((pt[0] - x0) * sx + 0.5),
int((y1 - pt[1]) * sy + 0.5)) # y up int((pt[1] - y0) * sy + 0.5))
try: try:
prims = hud2d_prims(board.dl2d, root) prims = hud2d_prims(board.dl2d, root)
+4
View File
@@ -196,6 +196,10 @@ in vec2 in_pos;
void main() { void main() {
vec2 p = vec2((in_pos.x - u_rect.x) / (u_rect.z - u_rect.x), vec2 p = vec2((in_pos.x - u_rect.x) / (u_rect.z - u_rect.x),
(in_pos.y - u_rect.y) / (u_rect.w - u_rect.y)) * 2.0 - 1.0; (in_pos.y - u_rect.y) / (u_rect.w - u_rect.y)) * 2.0 - 1.0;
// dpl2d Y grows DOWN (screen convention): period VHS footage shows the
// 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, 0.0, 1.0);
} }
""" """