Feature Request: Deposterization filter for xBRZ #826

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

Comments

Projects
None yet
6 participants
@DonelBueno

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

This comment has been minimized.

Show comment
Hide comment
@ADormant

This comment has been minimized.

Show comment
Hide comment
@gonetz

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Jan 16, 2016

Owner

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.

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

This comment has been minimized.

Show comment
Hide comment
@theboy181

theboy181 Jan 16, 2016

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

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

@gonetz

This comment has been minimized.

Show comment
Hide comment
Owner

gonetz commented Jan 17, 2016

@ADormant

This comment has been minimized.

Show comment
Hide comment
@gonetz

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Jan 18, 2016

Owner

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

Owner

gonetz commented Jan 18, 2016

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

@DonelBueno

This comment has been minimized.

Show comment
Hide comment
@DonelBueno

DonelBueno Jan 18, 2016

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

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

@DonelBueno

This comment has been minimized.

Show comment
Hide comment
@DonelBueno

DonelBueno Jan 19, 2016

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.

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

This comment has been minimized.

Show comment
Hide comment
@ADormant

ADormant Jan 19, 2016

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

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

This comment has been minimized.

Show comment
Hide comment
@DonelBueno

DonelBueno Jan 20, 2016

@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 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

This comment has been minimized.

Show comment
Hide comment
@ADormant

ADormant Jan 20, 2016

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

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

@gonetz

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Jan 21, 2016

Owner

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.

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

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Feb 10, 2016

Owner

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

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

This comment has been minimized.

Show comment
Hide comment

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

@gonetz

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Feb 16, 2016

Owner

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.

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

This comment has been minimized.

Show comment
Hide comment
@ADormant

ADormant Feb 16, 2016

Hmm PS1 texture cache is only 2kb.

Hmm PS1 texture cache is only 2kb.

@gonetz

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Apr 7, 2016

Owner

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

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

This comment has been minimized.

Show comment
Hide comment
@oddMLan

oddMLan Apr 7, 2016

Contributor

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.

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

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Apr 8, 2016

Owner

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

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

This comment has been minimized.

Show comment
Hide comment
@oddMLan

oddMLan Apr 8, 2016

Contributor

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

Contributor

oddMLan commented Apr 8, 2016

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

@DonelBueno

This comment has been minimized.

Show comment
Hide comment
@DonelBueno

DonelBueno Apr 11, 2016

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.

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

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Apr 16, 2016

Owner

Done

Owner

gonetz commented Apr 16, 2016

Done

@gonetz

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Dec 15, 2016

Owner

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.

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

This comment has been minimized.

Show comment
Hide comment
@fzurita

fzurita Dec 15, 2016

Contributor

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

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

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Dec 15, 2016

Owner

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

Owner

gonetz commented Dec 15, 2016

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

@gonetz

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Dec 15, 2016

Owner

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

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

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Dec 15, 2016

Owner

Fixed.

Owner

gonetz commented Dec 15, 2016

Fixed.

@gonetz gonetz closed this Dec 15, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment