Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct texture projection issues, mainly in softgpu #16117

Merged
merged 7 commits into from
Sep 27, 2022

Conversation

unknownbrackets
Copy link
Collaborator

@unknownbrackets unknownbrackets commented Sep 27, 2022

This includes q in the interpolated stq to properly project coordinates, which wasn't being done before. Fixes the ground in TOCA (from a frame dump.)

Along the way, this also fixes texture projection with flat shading (outside GL/GLES), as well as what (0, 0, 0) normalizes to for the purposes of texture projection. These are probably very rare cases, though.

Did some other confirmations:

  • Processing when UV or normal not in vertex type (it uses whatever value was most recently specified.) Implemented, but in software renderer only.
  • Confirmed texture projection doesn't happen in through, but does happen for transformed rectangles.
  • Confirmed UV scale/offset does not apply to the texgen result, regardless of source.
  • Confirmed weights do apply to the texgen source (i.e. normals, etc.)

Tried to do this carefully so there's neutral impact to performance for the common cases.

See also hrydgard/pspautotests#226 (doesn't exactly pass these tests, due to some precision issues.)

-[Unknown]

@hrydgard
Copy link
Owner

hrydgard commented Sep 27, 2022

Very interesting! Do we have an issue about the TOCA ground problem? Did it only affect software?

I'll review this in a bit.

@unknownbrackets
Copy link
Collaborator Author

It only affected software. This frame dump: #16049 (comment)

The hardware rendering tweaks here were all correctness changes, I'm not sure any game actually triggers them.

-[Unknown]

@hrydgard hrydgard merged commit 29d8f40 into hrydgard:master Sep 27, 2022
@unknownbrackets unknownbrackets deleted the softgpu-texgen branch September 27, 2022 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants