Project

General

Profile

Actions

Emulator Issues #11368

closed

Possible transparency issue with custom PNG textures

Added by eleriaqueen almost 6 years ago. Updated almost 6 years ago.

Status:
Working as intended
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

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

PNG
In-Game

What are your PC specifications?

Win10, Nvidia GTX660 Graphics card


Files

Untitled.png (32.6 KB) Untitled.png PNG in editor eleriaqueen, 08/31/2018 01:47 PM
GPOE8P-6.png (4.34 KB) GPOE8P-6.png In-game eleriaqueen, 08/31/2018 01:47 PM
GPOE8P- Dolphin5.png (8.42 KB) GPOE8P- Dolphin5.png In-game in Dolphin 5.0 eleriaqueen, 08/31/2018 01:58 PM
GPOE8P- Dolphin5-Zoom.png (18.3 KB) GPOE8P- Dolphin5-Zoom.png In-game (zoomed) in Dolphin 5.0 eleriaqueen, 08/31/2018 02:03 PM
tex1_256x256_74080580af0f7ed9_a56a4326a70cef3b_9.png (15.1 KB) tex1_256x256_74080580af0f7ed9_a56a4326a70cef3b_9.png Custom texture eleriaqueen, 08/31/2018 02:06 PM
tex1_256x256_74080580af0f7ed9_a56a4326a70cef3b_9_transparencymod.png (19.8 KB) tex1_256x256_74080580af0f7ed9_a56a4326a70cef3b_9_transparencymod.png AdmiralCurtiss, 09/08/2018 09:08 PM
Actions #1

Updated by JosJuice almost 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 almost 6 years ago

Sorry I messed up when linking my images.
I added them as attachments.

Actions #3

Updated by eleriaqueen almost 6 years ago

5.0 has an issue as well, but not sure if it's the same.

Actions #4

Updated by eleriaqueen almost 6 years ago

Added a zoomed in-game screenshot of Dolphin 5.0

Actions #6

Updated by eleriaqueen almost 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.

Actions #7

Updated by eleriaqueen almost 6 years ago

To clarify, I tested build 5.0-8596 and the issue was not present, no artifact.

Actions #8

Updated by eleriaqueen almost 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.

Actions #9

Updated by AdmiralCurtiss almost 6 years ago

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?

Actions #10

Updated by eleriaqueen almost 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.

Actions #11

Updated by AdmiralCurtiss almost 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.

Actions #12

Updated by JosJuice almost 6 years ago

  • Status changed from New to Working as intended
Actions #13

Updated by eleriaqueen almost 6 years ago

Very interesting read, it's a very specific problem I never heard about until now :)

Actions #14

Updated by eleriaqueen almost 6 years ago

Discarding color from alpha in Gimp's export function seems to do the trick too.

Actions

Also available in: Atom PDF