Opened 6 months ago

Closed 5 months ago

#15151 closed defect (invalid)

BACKENDS: OPENGL: Alpha channel changes cause color regression on PowerBook G4

Reported by: dwatteau Owned by: lephilousophe
Priority: normal Component: Graphics
Version: Keywords:
Cc: Game:

Description

I'm seeing a regression with commit 6342045cc3e23dc9f685241d89ad3da478885f70 ("BACKENDS: OPENGL: Don't take the alpha channel from the game texture") (as found by a Git bisect).

This appears with any game (but not the menu), only in opengl mode, not in surfacesdl mode.

ScummVM 2.8.x doesn't have this problem. I don't think it's OS-related, because I see this issue on both OpenBSD/macppc and Debian ppc.

The machine is a G4 PowerBook5,6 (big-endian PPC processor), with an ATI Radeon Mobility 9600/9700 (M10/M11) GPU.

I don't know if the issue is endian-related, or just old-GPU-related.

Attaching some files below. Feel free to ping me for any test!

Attachments (4)

maniac-v2-fr-opengl-bug.png (4.8 KB ) - added by dwatteau 6 months ago.
Buggy color behavior with OpenGL renderer
maniac-v2-fr-surfacesdl-ok.png (5.1 KB ) - added by dwatteau 6 months ago.
Normal color behavior with surfacesdl renderer
opengl-d6-output-powerbook-g4.txt (838 bytes ) - added by dwatteau 6 months ago.
-d6 debug output with OpenGL renderer
glxinfo-powerbook-g4-mesa.txt (750 bytes ) - added by dwatteau 6 months ago.
glxinfo output on Debian and OpenBSD

Download all attachments as: .zip

Change History (7)

by dwatteau, 6 months ago

Attachment: maniac-v2-fr-opengl-bug.png added

Buggy color behavior with OpenGL renderer

by dwatteau, 6 months ago

Normal color behavior with surfacesdl renderer

by dwatteau, 6 months ago

-d6 debug output with OpenGL renderer

by dwatteau, 6 months ago

glxinfo output on Debian and OpenBSD

comment:1 by dwatteau, 6 months ago

FWIW, as suggested by lephilousophe, doing this change in backends/graphics/opengl/framebuffer.cpp:

                case kBlendModeOpaque:
                        GL_CALL(glEnable(GL_BLEND));
-                       GL_CALL(glBlendColor(1.f, 1.f, 1.f, 0.f));
+                       GL_CALL(glBlendColor(1.f, 1.f, 0.f, 1.f));
                        GL_CALL(glBlendFunc(GL_CONSTANT_COLOR, GL_ONE_MINUS_CONSTANT_COLOR));
                        break;

or using glBlendColor(1.f, 1.f, 1.f, 1.f), make the color problem go away. Putting a value of 0.f for the red or green parameters doesn't fix the issue, however.

I see that both my Debian and OpenBSD systems use the same Mesa release; I'll try updating one of them to Mesa 23.x to see if it fixes anything.

comment:2 by dwatteau, 5 months ago

As a summary of what's been said on Discord:

lephilousophe made a small test program here: <https://gist.github.com/lephilousophe/1f8bb6757a8d621e6400fc9edd57a306>. I confirm that it shows the expected behavior on x86-64, and buggy output on this machine.

Updating from Mesa 22.3.6 to Mesa 23.1.9 didn't fix the issue. Then I tried updating to Mesa 23.3.6, but that version has some other (unrelated) problems. I'll try finding some time to fix this, before I report the issue to Mesa.

Anyway, big-endian is becoming more and more of a niche thing, so more and more bugs will appear on these untested systems. It's probably time for me to freeze my PPC dev environment to something older, but more reliable.

Anyway, yes, we can consider this as a Mesa bug, not a ScummVM bug.

comment:3 by dwatteau, 5 months ago

Owner: set to lephilousophe
Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.