Emulator Issues #4696
closedOGL: Metroid Prime thermal and X-ray visors don't work.
0%
Description
What steps will reproduce the problem?
- Set the video backend to OpenGL.
- Start Metroid Prime 1.
- Switch to the thermal or X-ray visors.
What is the expected output? What do you see instead?
Expected: The thermal visor should apply a purple-to-orange palette effect to the framebuffer. The X-ray visor should apply a blue-to-white palette effect to the framebuffer.
Observed: The world graphics either turn black or display a grayscale version of the world without any palette effect.
Dolphin version with the problem? Other Dolphin version without the
problem?
This has occurred ever since the texcache-rewrite merge in r7625. There's something wrong with the GLSL depalettizer. Previous versions performed depalettizing on the CPU. This problem occurs with any combination of EFB Copy settings.
32-bit or 64-bit and any other build parameters?
Happens in all 64-bit builds, 32-bit not tried.
OS version and versions of tools/libraries used?
OS: Windows 7 x64
Graphics: Radeon HD 5750, AMD Catalyst 11.6 drivers
Please provide any additional information below.
Both visor effects work by rendering the framebuffer to a texture in 8-bit grayscale, then interpreting the texture with a 256-color palette. This works fine in DX9 and DX11, but in OpenGL it seems to use the grayscale texture directly without applying the palette. Sometimes, the effect appears all black until I switch in and out of the visors a few times.
gDEBugger reveals that the depalettizer is generating a texture with the palette applied, but this colorized texture is somehow being discarded or mixed up with the original grayscale.
Other palette effects, including MP1's text and Twilight Princess's map, work fine.
Does this happen on other systems? Please comment.
Updated by EmanModnar over 13 years ago
Do you have a save file that far into the game? I only recently ripped my MP1 disc and haven't had a chance to play it in Dolphin yet.
Updated by Nolan.Check over 13 years ago
I'll email my memory card file to anyone who needs it.
Updated by EmanModnar over 13 years ago
Okay, I was able to test on my Geforce GTX 285. At first it looked like the Thermal Visor was doing something different than what you described, but it turned out to be coloring from the gasses in the save room you were in. Further testing just confirmed what you already reported. At least this rules out any implementation differences. :/
Wish I could help further.
Updated by EmanModnar over 13 years ago
Yes, it works fine in DX11, Haven't tested DX9 yet.
Updated by pierre over 13 years ago
r7633 seems to be still correct. With r7634 and later, the thermal overlay and the x-ray view is not rendered correctly.
Updated by Autoran1 over 13 years ago
DX9 also works fine but there's huge memory leak somewhere, the game will hang or crash after using Thermal visor for a while, you can see it in the windows task manager
the memory usage of Dolphin will raise until crash or hang
Updated by pierre over 13 years ago
The problem with the OGL Depalettize() is, that we are modifying the texture state and don't restore it properly. The reason for this is probably that Depalettize() is called from the VertexManagers vFlush() while setting up textures(via g_textureCache->LoadEntry()).
Updated by Nolan.Check over 13 years ago
Hey, you're right! I'm working on a fix right now.