Skip to content

Plugin API 30: screen_shapes, so Quake's crosshair is UI to frame generation - #254

Open
Kyoskii wants to merge 1 commit into
masterfrom
plugins/screen-shapes-crosshair
Open

Kyoskii wants to merge 1 commit into
masterfrom
plugins/screen-shapes-crosshair

Conversation

@Kyoskii

@Kyoskii Kyoskii commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

With frame generation on, Quake's crosshair smeared between real frames.

Cause

Quake drew the crosshair as the game's debug shapes, which play into the 3D after the scene and before the HUD. Frame generation's HUD-less copy is the display buffer just before the HUD's first draw, so it contained the crosshair, and AMD treated the crosshair as scenery to interpolate.

The host: screen_shapes (plugin API 30)

  • int (*screen_shapes)(const char* name, const BbScreenTri* tris, size_t n) is appended after cutscene(), so plugins built against 29 keep working.
  • A BbScreenTri has its three corners in the picture's 0–1 space plus a colour with alpha.
  • The window's pump adds the plugins' triangles to the host overlay, the same layer as the FPS counter and pointer. The presenter draws that overlay after the HUD, so frame generation, the upscalers and TAA all treat it as UI.
  • Each call replaces the plugin's previous list, and n = 0 clears it. A list not refreshed for 250 ms disappears by itself, so a plugin that stops calling leaves nothing on screen.
  • A plugin that is off can't set a list. The limit is 2048 triangles, called from the main thread.
  • plugin_abi_test checks the table's new end and BbScreenTri's layout. docs/plugins.md documents the call.

Quake 0.3.26

  • On a version-30 host, the crosshair is drawn through screen_shapes, centred and matched to the picture's aspect:
    • the ring is a band one 480-line pixel wide with fainter edges, like the old halo of debug lines;
    • the dot is a filled disc.
  • It's cleared immediately when Quake lets go of the player, when the hunter dies, or when the crosshair setting is off.
  • On older hosts it still draws the debug shapes as before.

The version bump goes from 0.3.24 to 0.3.26; #253, which takes Quake to 0.3.25, will conflict on that one line.

Checks

  • Built on Windows (MSYS2 UCRT64, RelWithDebInfo); plugin_abi_test passes.
  • Headless on a copy of a save with Quake on: through a cutscene and a lamp travel, no crash, clean exit. The dumped display buffer, the image frame generation's HUD-less copy is taken from, no longer contains the crosshair at the centre.
  • Not yet checked in a window with frame generation on. The overlay path is the one the FPS counter already uses, but nobody has looked at it on screen.

🤖 Generated with Claude Code

…ch frame generation takes for UI; Quake 0.3.26's crosshair drawn with it

Quake's crosshair was the game's debug shapes, played into the 3D after the
scene and before the HUD: frame generation's HUD-less copy (the display
buffer before the HUD's first draw) held it, so AMD took it for 3D and
generated frames carried it smeared between the real ones.

screen_shapes(name, tris, n), plugin API 30 (appended after cutscene()):
triangles in the picture's 0..1, a colour with alpha, that the window's pump
puts into the host overlay - the FPS counter's - which the presenter draws over
the frame after the HUD, as the pointer and the counter are. Frame generation,
the upscalers and the TAA never see it, the same as the HUD. A call replaces
the plugin's last list, n = 0 takes it away, and a list not given again for a
quarter of a second goes by itself (a plugin that stops - a load, a crash of
its hook - leaves nothing on screen); a plugin that is off cannot set one.
plugin_abi_test checks the table's new end and BbScreenTri's layout.

Quake 0.3.26 draws its crosshair that way where the host has version 30 - the
ring as a band one 480-line pixel wide with fainter edges, the dot a disc,
at the picture's middle with the picture's aspect - and takes it away at
once when it lets go of the player, when the hunter dies or the crosshair is
off; on an older host it draws the debug shapes as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Test build of ac5e587: Windows zip, Linux tarball and Steam Deck kit, unsigned, kept 14 days.
Download windows, linux or steamdeck (each with its package), or release (everything), from the bottom of the run page:
https://github.com/droogie/bbhost/actions/runs/43770780359#artifacts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant