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

Feature Request: Deposterization filter for xBRZ #826

Closed
DonelBueno opened this issue Dec 27, 2015 · 28 comments
Closed

Feature Request: Deposterization filter for xBRZ #826

DonelBueno opened this issue Dec 27, 2015 · 28 comments

Comments

@DonelBueno
Copy link

xBRZ scaling leaves the textures with posterization issues. The same issue happened on PPSSPP, but they sorted it out with a deposterization step. The issue and the solution are both described here:

http://blog.metaclassofnil.com/?p=306

Example of the issue in GLideN64:

project64 2015-12-27 08-06-57-84

project64 2015-12-27 08-08-23-79

Pay attention to the sky texture. The first one is xBRZ filtered, the second one is HQ4x.

It's way more evident in some games, like in Ocarina of Time. The ground texture in that game gets really distracting.

@ADormant
Copy link

ADormant commented Jan 3, 2016

@gonetz
Deposterize Tinob/Ishiiruka@d2fb925

@ADormant
Copy link

@gonetz Deposterize shader libretro/common-shaders@cc81b1f

@gonetz
Copy link
Owner

gonetz commented Jan 16, 2016

I've added the deposterization step from Ishiiruka's code:
78d7c99
I don't see much difference though.

I can't share the binary via googledrive because it says that the file is infected. I tested the file via virustotal - ClamAV reports about Win.Adware.Browsefox-12346, others 54 antiviruses reports that the file is clean. If you need the binary, you may write me an email, I'll send the file to you.

@theboy181
Copy link

Zip with password protection and share the password in the info file.

@gonetz
Copy link
Owner

gonetz commented Jan 17, 2016

Good idea. The binary:
https://drive.google.com/file/d/0B0YqMPjGo3B2VU0tVkdST0ViUWc/view?usp=sharing

pass: deposterization

@ADormant
Copy link

@gonetz Changes are supposed to be subtle http://libretro.com/forums/showthread.php?t=4908

@gonetz
Copy link
Owner

gonetz commented Jan 18, 2016

If you see the positive difference in quality, I'll add that code to master.

@DonelBueno
Copy link
Author

I'll check it out soon and then post the results here. Thanks for the attention.

@DonelBueno
Copy link
Author

Test Results:

No Texture Scaling:
1- no scaling

HQ 4x Texture Scaling:
2- hq 4x

6xBRZ Texture Scaling:
3- 6x xbrz

6xBRZ + Deposterization texture Scaling:
4- 6x xbrz deposterization

As you can see, there is basically no change to the posterization on the ground textures.

@ADormant
Copy link

Colors are better with deposterize enabled, Buttons around Navi button become lighter yellow instead of brownish and green circle seems to have better transparency.

@DonelBueno
Copy link
Author

@ADormant You must be comparing the wrong images. Compare 6xBRZ Texture Scaling to 6xBRZ + Deposterization texture Scaling (the last two images).

They are basically the same, aside from some very minor differences on the ground textures, but these differences aren't for the better, they are just different.

@ADormant
Copy link

Still wouldn't hurt to add it looks somewhat different after all.

@gonetz
Copy link
Owner

gonetz commented Jan 21, 2016

It hurts performance, since the deposterization step is not free. I can make it optional though.

Regarding the result: it is probably a bad idea to use maximal BRZ level. Try 3x or 4x BRZ, may be difference will be more noticeable.

@gonetz
Copy link
Owner

gonetz commented Feb 10, 2016

I suggest to close this issue since deposterization step does not help to solve problems with xBRZ and N64 textures.

@ADormant
Copy link

@gonetz Deposterize is good for games with dithering https://github.com/tapcio/PeteOpenGL2Tweak/releases

@gonetz
Copy link
Owner

gonetz commented Feb 16, 2016

Most of N64 textures use 16bit color, however deposterization has no visible effect. N64 texture size may negate the effect, because N64 texture memory is just 4kb.

@ADormant
Copy link

Hmm PS1 texture cache is only 2kb.

@gonetz
Copy link
Owner

gonetz commented Apr 7, 2016

I have fixed an issue in GLideNHQ code and now deposterization effect is clearly visible

Test binary:
super_mario_64-001
super_mario_64-004

https://drive.google.com/file/d/0B0YqMPjGo3B2LTVtcHAzX3ZDUjg/view?usp=sharing

@oddMLan
Copy link
Contributor

oddMLan commented Apr 7, 2016

Earthworm Jim 64 - Normal
ewj_no_post
Earthworm Jim 64 - X2 + Deposterization
ewj_x2_with_post
Earthworm Jim 64 - xBR 3x Normal
ewj_xbrx3_no_post
Earthworm Jim 64 - xBR 3x + Deposterization
ewj_xbrx3_with_post
Zelda OOT - Normal
oot_no_post
Zelda OOT - X2 + Deposterization
oot_x2_with_post
Zelda OOT - xBR x4 Normal
oot_xbrx4_no_post
Zelda OOT - xBR x4 + Deposterization
oot_xbrx4_with_post

I wonder how deposterization helps KI Gold. I'll test later.

@gonetz
Copy link
Owner

gonetz commented Apr 8, 2016

So, deposterization is useful after all. I'll add it to master. I think, it should be optional though.

@oddMLan
Copy link
Contributor

oddMLan commented Apr 8, 2016

I agree; it should be optional. Just like in PPSSPP.

@DonelBueno
Copy link
Author

I helps Earthworm Jim a lot, but it doesn't seem to help OOT.

I also think it's a good idea to include it into master.

@gonetz
Copy link
Owner

gonetz commented Apr 16, 2016

Done

@gonetz
Copy link
Owner

gonetz commented Dec 15, 2016

Has anybody my dev branch with Deposterization feature in your local git repository?
Deposterization is completely broken in master. It seems that I broke on when merged code to master.

@gonetz gonetz reopened this Dec 15, 2016
@fzurita
Copy link
Contributor

fzurita commented Dec 15, 2016

What's breaking it? I'm not seeing any issues right now with it enabled in Android. Amy specific examples?

@gonetz
Copy link
Owner

gonetz commented Dec 15, 2016

I have issues in every game, e.g.:
#1301

@gonetz
Copy link
Owner

gonetz commented Dec 15, 2016

I see the problem. It happens only on devices with multicore CPU, if GLideNHQ can detect number of cores.

@gonetz
Copy link
Owner

gonetz commented Dec 15, 2016

Fixed.

@gonetz gonetz closed this as completed Dec 15, 2016
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

No branches or pull requests

6 participants