Files
Thomas MartinandClaude Opus 5.5 c7f4512d98 Native renderer: frame rates above the game's, the frames between its two latest drawn interpolated
The window can run on its own clock (Renderer::setFrameRate: 0 the game's, the default and unchanged; -1 the
monitor's refresh with vsync; n a set rate without vsync) and draw at each present the game's two latest published
frames blended by where that clock lies between them, one game frame behind. The game's logic rate is not touched.

- Clock: each published frame gets a place on a smoothed clock (the publishing interval averaged, each frame pulled
  10% toward its real time; restarted after a 250 ms pause or a 4-interval hitch, no blending across it); the window
  draws now - (interval + recent lateness + 2 ms), between the pair of the last six frames around it; past the newest
  it holds the newest.
- Objects: setKey(key, base) and setParts(camera, object): the matrix as camera x object, blended apart (camera
  linearly, the object's rotation by slerp with its scales and translation linearly); a turn over 90 degrees a frame
  (a wheel) keeps the newer turn with its place blended; a teleport (camera-space step over half the distance) or no
  match: the newer frame's; gone: not drawn. matchFrames, once per frame pair: objects alone of their kind in their
  view (clip) by themselves; alike ones (same base) to the nearest previous one, as it was or moved by the view's
  camera move (D = A' A^-1 of the unique object most others agree with), whichever separates them better; ambiguous
  (second nearest within twice the distance) drawn as the newer frame. A view where 60% of the matched objects jumped
  is a cut.
- drawTracked: screen-space triangles with ids (particles, sprites); a triangle found in the previous frame has its
  corners blended. MeshSubmitter passes MeshDraw's keyBase and parts (partCamera, partObject) and tracks keyed
  screen-space draws per triangle.
- A frame is uploaded once while it is shown (its tracked triangles again when blended).
- Present loop: followFrames only at the game's rate (unchanged default); vsync only for the monitor's rate, with a
  timer fallback when presents run 1.5x past the refresh. Video tab: "Frame rate" (60 the game's / match the
  monitor, a set rate offered as it is); video.ini frame_rate, PS2X_FRAME_RATE; PS2X_NATIVE_INTERPOLATE=1
  (+PS2X_PRESENT_FPS) maps to it.
- Diagnostics: PS2X_PRESENT_STATS=1 at a rate above 60: every 2 s presents/s, game frames/s, keyed batches and
  tracked triangles interpolated, teleports / spins / ambiguous / cuts, held presents, the longest still picture and
  present gap, present() time, the largest turn. PS2X_CAPTURE_SEQUENCE=<n> (+_AT=<s>,..., F8): n consecutive presents
  kept in memory then written as seq<k>_<i>.png with seq<k>.txt (time, frames, alpha) and the moving objects' origins
  logged over them ([interp-trace], followed through their match). PS2X_INTERP_LOG=1 the teleports and spins,
  PS2X_INTERP_CHECK=1 the parts against the matrix.

Measured with TMB (640x448): 141-144 presents/s at 144 with the game at 59.0-59.5, 96-100% of keyed batches
interpolated, present() 1.2-3.5 ms; unlimited 400-650 presents/s; default still 0-1 of 600 frames not shown.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-02 00:40:13 +01:00
..
2026-09-19 21:31:44 -03:00
2026-09-19 21:31:44 -03:00