-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Implement smooth depal lookups for Test Drive's strange usage. #15710
Conversation
69b4fb1
to
54e8324
Compare
54e8324
to
18500b9
Compare
Here you noted that they're nice ramps: I've seen these before in several games. I feel like we could detect this when building the CLUT texture (based on entries from 0 to the mask, maybe only when offset is 0 which is the common case.) We'd want to check if color or alpha test (other than > 0) is used, which are probably very unlikely anyway. I think we could then do this without any compat flag, generally, maybe only when the user setting for texture filtering is set to other than NEAREST. I feel like this would make more games than just Test Drive look better. We could generalize it for all the 16-bit formats, or just also ignore the ramps for 4444. -[Unknown] |
You're right that we could and probably should try to detect them, plan to do that when I get around to picking this up again. For now at least this branch serves as a proof of concept, there's more work to be done anyway before it's ready to go. |
18500b9
to
97959f6
Compare
Changed it to autodetect the ramp. Will clean up the sampler handling and enable it in regular depal too tomorrow. |
97959f6
to
89d05b7
Compare
This implements the hack I suggested in #13355, where instead of first reducing the color to RGB565 as the real game does, we just take each channel at full precision and do the lookup according to the mask, linearly filtering the palette. This makes the game look a lot nicer and is also a small optimization, but the hack is very specific so kinda ugly in a way.
1d9717d
to
a2e2d00
Compare
Rebased on master, implemented the new checks and stuff. I think this is ready now, unless I've forgotten something again. |
a2e2d00
to
e3943f6
Compare
This implements the path I suggested in #13355, where instead of first reducing the color to RGB565/RGB555 as happens on the real device (well, it's already that low bit depth in the frame buffer, just dithered), we take each channel at full precision according to the mask and do the lookup, linearly filtering the CLUT (palette) if it just contains a smooth gradient.
This makes the game look a lot nicer. Maybe somewhat inauthentic, but at least better than using the cheats that remove the color effect entirely, and I'd argue that within our enhanced high-color PSP world, this is definitely the best way to interpret the original intent.
Before (ignore the framerate, was in Debug mode and loaded a state):
After:
NOTE: Needs a bit more work - should add support to the standalone depal shaders also, not just the in-shader depal mode which is only used in GL and Vulkan currently.
Also should make sure filtering the palette works on all the backends.