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

Chainner Chain Templates for PS2 Incorrectly Scale Alpha Channel #2

Open
shuttle128 opened this issue Jul 11, 2024 · 1 comment
Open

Comments

@shuttle128
Copy link

The 4xHDcube Plus Image File Iterator (PS2).chn file supplied with Ko-Fi subscription does not properly scale the alpha channel for PS2 textures after splitting and before merging. According to the PCSX2 texture_dump_alpha_scaler page PS2 graphics use a 128 bit alpha channel and needs to be scaled up to create a 256 bit channel prior to upscaling rather than stretching contrast. This introduces error into the texture passed to the upscaler. Then when the upscaled output is merged without rescaling back to 128 bit and the original file is used to scale the opacity the resulting final merged texture can be significantly off. This is especially a problem for textures with transparency as it can cause textures to become transparent that were not previously.

I've gotten much better results by scaling the color level white input 50% prior to upscaling, then after upscaling scaling the color level white output 50% (this is equivalent to the alpha scaling python script). The output from that can be piped to the alpha recombiner node without touching opacity modifiers or threshold nodes.

Attached is the chain I use that provides much better results.

4xHDcube Plus Image File Iterator (PS2) with alpha scaling.zip

@Venomalia
Copy link
Owner

Venomalia commented Jul 11, 2024

PCSX2 has changed its behavior in the past, since then the hold template no longer works as intended.
Not all textures are 128 bit alpha channel you don't seem to take that into account here, but i will consider this approach.
But I am working on a solution.

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

2 participants