mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 02:11:36 -04:00
dc4197c053
Pairing triangles of consecutive draw lists by key and draw order paired the wrong ones whenever the game reordered, culled or switched LODs (R4: a grandstand of one repeated texture turned into a staircase; on a synthetic version 225 of 226 pairs were wrong). No primitive is paired by draw order any more. gte.cpp notes each RTPS/RTPT output (only while generation is on) with an identity (issuing ra + model-space vertex), its camera-space position and H, indexed by screen word; gpu.c records each polygon vertex's source ahead of the triangle (RTH_FG_SRC, never drawn). Per view the camera motion between the two frames is fitted from the paired camera-space vertices (RANSAC + least squares); one real frame is redrawn from the in-between camera: world vertices re-projected, vertices moving against the world (cars) lerped in camera space, CPU-built vertices moved with their triangle, HUD/2D unchanged. Moving forward the older frame is redrawn; uncovered areas show the newer real frame. A verdict rejects the generated frame (the real one shows) without projections, with few pairs/inliers, or with a motion no camera makes. Real frames are unchanged (gl_frame_gen_test). PSX_PRESENT_SHOT_BURST=N captures the next N composed frames, real and generated, for checking in-between frames against their neighbours. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>