Skip to content

Correct texture projection issues, mainly in softgpu - #16117

Merged
hrydgard merged 7 commits into
hrydgard:masterfrom
unknownbrackets:softgpu-texgen
Sep 27, 2022
Merged

hrydgard merged 7 commits into
hrydgard:masterfrom
unknownbrackets:softgpu-texgen

Conversation

@unknownbrackets

@unknownbrackets unknownbrackets commented Sep 27, 2022 •

Copy link
Copy Markdown
Collaborator

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

hrydgard commented Sep 27, 2022 •

Copy link
Copy Markdown
Owner

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
Copy Markdown
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