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

Make DXT alpha and color calculation more accurate #11530

Merged
merged 6 commits into from
Nov 4, 2018

Conversation

unknownbrackets
Copy link
Collaborator

@unknownbrackets unknownbrackets commented Nov 4, 2018

This matches tests fairly well, except the DXT5 alpha case - it rounds slightly wrong for some alpha values.

With these changes, Gran Turismo looks pretty much the same as the GE dump played on real hardware. So fixes #5685.

There's still some mystery bits in that dump, but it doesn't seem like they do anything (didn't heavily test them though.)

-[Unknown]

Hardware tests show that this shouldn't happen.  May be important for
color tests, etc.
Hardware tests show this is how it decodes, which is more like standard
DXT1 decoding.
@unknownbrackets unknownbrackets added this to the v1.8.0 milestone Nov 4, 2018
Hardware draws using 2/3.  Adding this way matches rounding, too.
Hardware is still doing DXT1 style colors in this scenario.
Hardware doesn't seem to.
This isn't quite right, but it seems better than rounding down.
Experimented with a lower round up value, but none were right - the
weighting must be more complex.
@hrydgard
Copy link
Owner

hrydgard commented Nov 4, 2018

Regarding the rounding, could it be that the two multiplications are rounded to 8-bit or 9-bit separately before they are summed? Either way, great job figuring this out!

@hrydgard hrydgard merged commit 2c5922b into hrydgard:master Nov 4, 2018
@unknownbrackets
Copy link
Collaborator Author

Yeah, I was thinking it's probably that, although it generally rounds up...

-[Unknown]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bright horizontal Line in Gran Turismo
2 participants