Emulator Issues #4696

OGL: Metroid Prime thermal and X-ray visors don't work.

Added by Nolan.Check about 9 years ago.

% Done:


Operating system:
Issue type:
Relates to usability:
Relates to performance:
Relates to maintainability:
Regression start:
Fixed in:


What steps will reproduce the problem?
1. Set the video backend to OpenGL.
2. Start Metroid Prime 1.
3. 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
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.


#1 Updated by EmanModnar about 9 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.

#2 Updated by Nolan.Check about 9 years ago

I'll email my memory card file to anyone who needs it.

#3 Updated by EmanModnar about 9 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.

#4 Updated by Nolan.Check about 9 years ago

Does it work for you in DX9 and DX11?

#5 Updated by EmanModnar about 9 years ago

Yes, it works fine in DX11, Haven't tested DX9 yet.

#6 Updated by pierre about 9 years ago

r7633 seems to be still correct. With r7634 and later, the thermal overlay and the x-ray view is not rendered correctly.

#7 Updated by Autoran1 about 9 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

#8 Updated by pierre about 9 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()).

#9 Updated by Nolan.Check about 9 years ago

Hey, you're right! I'm working on a fix right now.

#10 Updated by Nolan.Check about 9 years ago

  • Status changed from New to Fixed

Should be fixed in r7673.

Also available in: Atom PDF