Emulator Issues #11368
closedPossible transparency issue with custom PNG textures
0%
Description
Game Name?
Phantasy Star Online Episode I&II
Game ID?
GPOE8P
MD5 Hash?
36a7f90ad904975b745df9294a06baea
What's the problem? Describe what went wrong.
Dolphin seems to have an issue with custom texture transparency (in PSO Ep. I&II).
There are visible "artifacts" (for lack of better term) in-game where there is none in the actual texture.
Version Number
5.0-8710
Is the issue present in the latest stable version?
Untested
Graphical Issue Showcase
What are your PC specifications?
Win10, Nvidia GTX660 Graphics card
Files
Updated by JosJuice about 6 years ago
Could you post a screenshot?
Also, it would be very helpful if you could test this in 5.0, since it uses a different way of loading PNG files.
Updated by eleriaqueen about 6 years ago
- File Untitled.png Untitled.png added
- File GPOE8P-6.png GPOE8P-6.png added
Sorry I messed up when linking my images.
I added them as attachments.
Updated by eleriaqueen about 6 years ago
- File GPOE8P- Dolphin5.png GPOE8P- Dolphin5.png added
5.0 has an issue as well, but not sure if it's the same.
Updated by eleriaqueen about 6 years ago
Added a zoomed in-game screenshot of Dolphin 5.0
Updated by eleriaqueen about 6 years ago
- File tex1_256x256_74080580af0f7ed9_a56a4326a70cef3b_9.png tex1_256x256_74080580af0f7ed9_a56a4326a70cef3b_9.png added
Added the custom texture file for reference.
Updated by eleriaqueen about 6 years ago
After some research I found out the issue I'm having started with the following change
- Use simplified libpng PNG reading API to avoid PNG reading bugs. (PR #7341 from AdmiralCurtiss)
It doesn't appear in build 5.0-8596 which was published before the change.
Updated by eleriaqueen about 6 years ago
To clarify, I tested build 5.0-8596 and the issue was not present, no artifact.
Updated by eleriaqueen about 6 years ago
My tests were done with PNG's from (the) GIMP's export function as well as Adobe Illustrator's, both produce a RGB image with 8-Bit alpha.
Updated by AdmiralCurtiss about 6 years ago
- File tex1_256x256_74080580af0f7ed9_a56a4326a70cef3b_9_transparencymod.png tex1_256x256_74080580af0f7ed9_a56a4326a70cef3b_9_transparencymod.png added
I don't have this game to test, but I think what you're actually seeing here is a texture interpolation issue. Your fully transparent pixels in the custom texture are internally white, which would look odd when interpolating against the neighboring almost-black.
I've attached a modified version where I replaced the fully transparent white pixels with fully transparent pixels matching the color value of the dark transparent GUI element. Can you test if this looks any different in-game?
Updated by eleriaqueen about 6 years ago
I tested Dolphin 5.0-8715 with your edited texture and there was no artifact. What's weird is that build 5.0-8596 and some earlier versions can load the original texture fine. To me it does still look like some useful code was lost in the simplification of PNG loading as even Adobe Illustrator created PNG files are "problematic" in this case.
Updated by AdmiralCurtiss about 6 years ago
The older versions appear the load the texture fine because their handling of transparency is nominally incorrect, which breaks other things. See issues like:
https://forums.dolphin-emu.org/Thread-hd-texture-problems
https://bugs.dolphin-emu.org/issues/11279
https://bugs.dolphin-emu.org/issues/11351
This 'color value of transparent pixels' is a thing that is somewhat specific to game development and can also happen in real games. Here's a good article about it: http://www.adriancourreges.com/blog/2017/05/09/beware-of-transparent-pixels/
A lot of programs fail to handle this sensibly by default because it's only ever apparent when you try to interpolate with the resulting image, which rarely happens outside of video games, and in practice you gain better image compression by discarding the color value of completely transparent stuff.
Updated by JosJuice about 6 years ago
- Status changed from New to Working as intended
Updated by eleriaqueen about 6 years ago
Very interesting read, it's a very specific problem I never heard about until now :)
Updated by eleriaqueen about 6 years ago
Discarding color from alpha in Gimp's export function seems to do the trick too.