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

Images that should be opaque are transparent #1

Closed
ege-del opened this issue Oct 30, 2024 · 3 comments
Closed

Images that should be opaque are transparent #1

ege-del opened this issue Oct 30, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation invalid This doesn't seem right

Comments

@ege-del
Copy link

ege-del commented Oct 30, 2024

No description provided.

@ShizCalev
Copy link
Contributor

ShizCalev commented Oct 31, 2024

I actually thought that at first too when I was first starting this project 6 months ago, but that is actually exactly how the PS2 worked! The PS2 had a different color depth from modern computers, meaning pixels that have 128 (50%) opacity were actually fully opaque on PS2, pixels that are 102 (40%) opacity were 80% on the PS2, 64 (25%) is 50%, ect.

The 2002 Xbox port, 2003 PC port, 2011 HD Collection, & 2023 Master Collection all have code that automatically doubles the opacity of all textures on-the-fly to account for the color depth difference on non-PS2 systems.

Likewise, if you convert the HD Collection or Master Collection's CTXR textures, you'll notice their color depth is exactly the same way. If I recall correctly, outright removing the alpha / setting the opacity to 100% also actually changes how lighting/specularity is displayed on that surface in the MGS2/MGS3 engine.

All the textures that are being uploaded to this repo are 100% unmodified/byte-accurate versions of the PS2 textures, color depth and all, and are fully functional with all versions of MGS2.


From PCSX2's own documentation on texture dumping:

Why Are My Textures Transparent?
The PS2 does not use the same color depth as a PC. As such, the alpha channel on a PS2 which would normally appear as fully opaque will turn 50% transparent when exported to a PC readable image.

How Do I Edit Them Like This?
Using your image editor of choice, you can raise the alpha level of a texture to 255 in order to edit it. Complete your work, then restore the alpha level back to the original value prior to inserting it into PCSX2.

How Do I Know What Alpha Level To Restore?
If a texture is partially transparent, then its alpha level is probably 128. If unsure, and if your image editor supports it, sample colors from the original texture to verify the alpha level. You should ensure that if the texture had alpha when dumped, it is set to the same value prior to loading in PCSX2.

(The PCSX2 folks even have their support bot on discord preprogrammed to say it since it's so frequently asked in their support channel. xP)
EIfDGqf

PCSX2's team does provide tooling on their repo to convert the textures to a modern color depth if you need to use the textures in a different engine:
https://github.com/PCSX2/pcsx2/blob/master/tools/texture_dump_alpha_scaler.py

Or if you need to outright strip alpha from everything, I typically use chainner (again though as I previously said, removing alpha & using the texture in MGS2's engine WILL change how lighting works on the model if you don't know what you're doing, so you typically NEVER want to do that if you're working on Master Collection stuff.)
image

@ShizCalev ShizCalev added the invalid This doesn't seem right label Oct 31, 2024
@ShizCalev ShizCalev pinned this issue Oct 31, 2024
@ShizCalev ShizCalev added the documentation Improvements or additions to documentation label Oct 31, 2024
@ShizCalev
Copy link
Contributor

ShizCalev commented Oct 31, 2024

Added an FAQ section to the repo's readme explaining that this is fully intended / exactly how the textures are supposed to be. Thanks for bringing it up! ♥

@ShizCalev ShizCalev closed this as not planned Won't fix, can't repro, duplicate, stale Oct 31, 2024
@ege-del
Copy link
Author

ege-del commented Oct 31, 2024

Thank you for the detailed explanation! I've already written a python script to remove the alpha values but I wasn't sure if this is the correct data representation or some artifact from tools you use. Since it is the correct data representation and there are tools available to strip the alpha values I wont send a pull request, but let me know if you need any help regarding data processing with python that can't be achieved with existing tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants