Optional perspective-correct texture interpolation
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 38/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- c, web-dev
- Domain
- backend-api-design
Research direction
Read repro.c for the prototype API and inspect PsyZ’s projection and textured GPU packet submission paths to find where per-vertex reciprocal depth could be retained and passed through. Then check the renderer’s interpolation behavior across primitives and platforms; done means opt-in perspective-correct UVs with affine rendering as the default, independent of fractional vertex positions, and the listed color, masking, transparency, sorting, and culling behavior preserved.
Written by the indexing model from the issue text.
Description
This is an opt-in enhancement request, not a PS1 accuracy defect. Affine texture interpolation reproduces the original hardware, but can make textures visibly slide or bend across a surface as its orientation changes.
Synthetic demonstration
One textured quad and a generated checkerboard compare affine mapping with reciprocal-depth interpolation. The screen-space vertices are identical in both renders; only texture interpolation changes.
repro.c contains the complete synthetic example and the declaration of its experimental port API. That API is not available in unmodified PsyZ; this is a prototype usage example, not a baseline buildable reproducer. The captures use our patched backend. The generated checkerboard contains no game assets.
Game demonstration
Two separate videos show one complete 360° turn of Orbital. Fractional vertex positions are enabled in both videos; only affine versus perspective-correct texture mapping changes.
Before — Affine texture mapping
https://github.com/user-attachments/assets/9726bd8e-a5bc-4005-a321-263057192122
After — Perspective-correct texture mapping
https://github.com/user-attachments/assets/1e9ae824-b7fa-4525-9fd4-e6b721591c06
Each clip is approximately 24 seconds at 30 fps. A diagnostic build sets the same model angle for each corresponding frame, covering a full turn and returning to the starting angle. Both clips use the same crop and scale. Menu background animations run independently; compare the car preview. These are separate continuous turns, not concatenated mode switches.
Captured from TM4 Rewired 38e6d4e with a local prototype based on PsyZ 35c673ecf1c4ba799a812d701918c2c52935475b. Only rendered footage is supplied: no game source, executable, model or texture files.
Requested capability
Allow optional per-vertex reciprocal depth alongside a textured GPU packet and use it for perspective-correct UV interpolation. Keep affine mapping when the additional information is absent or invalid, and make this independently switchable from fractional vertex positions.
Packet data alone does not preserve the depth needed for reliable correction; our prototype retains it during projection and associates it with submitted vertices. Keep depth sorting, culling and simulation unchanged. Texture perspective must not unintentionally change Gouraud color interpolation, mask/STP behavior or transparency.
These demonstrations establish feasibility, not a finalized API or complete compatibility coverage for every primitive/platform. Classic affine rendering should remain the default.
Captured in Chromium 157 / WebGL2 on macOS arm64, with render scale 3× for the game footage. The synthetic checkerboard uses a 320×240 VRAM readback.
- Dominant language
- C
- Stars
- 107
- Forks
- 26
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 5
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Xeeynamo/psyz
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 5/5 Over a week Newbie friendliness 38/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Similar issues
-
GXF: heap buffer overflow in parse_ad_cdp() — unbounded cc_count in CDP cc data sectionPossibly taken @pranayr710 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
CCExtractor/ccextractor#2498 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
area: services kind: bug preview-effort: small priority: low
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Static Analysis failurePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100