Emulator Issues #3477
closedMetroid Other M black cutscenes and projection hack patch
0%
Description
What steps will reproduce the problem?
- Playing the game
What is the expected output? What do you see instead?
Cut scenes are often black
Dolphin version with the problem? Other Dolphin version without the
problem? Seems like they all experience the problem.
32-bit or 64-bit and any other build parameters? Both
OS version and versions of tools/libraries used? Win 7
Further Details:
I have implemented my own projection hack for this issue and have it attached here as a patch, but I don't necessarily think that it is a fix. I think that a hack should be added as a temporary solution until someone can determine the overarching issue; that is if there is one. I have not yet tested this patch extensively, but it appears to be working as expected without any adverse effects.
It appears that there are several projection layers stacked on each other. At the base, you have a perspective view and on top of that various layers for text, huds, lighting, etc. One of these layers appears to be either for EFB copy or some kind of bloom effect.
The EFB copy / bloom layer, at least as indicated by the source, is Orthographic. Through some testing I believe it to be indicated by the following values (at least in Metroid other M as I did not perform testing on any other games):
xfregs.rawProjection[0] = 2.0f
xfregs.rawProjection[1] = -1.0f
xfregs.rawProjection[2] = -2.0f
xfregs.rawProjection[3] = 1.0f
xfregs.rawProjection[4] = -1.0f
xfregs.rawProjection[5] = -1.0f
xfregs.rawProjection[6] = 0.0f
For whatever reason, in Metroid other M, during nearly every cut scene, this layer contains a black box, the size of this box seems to be based on g_fProjectionMatrix[15] located in VertexShaderManager::SetConstants. As shown below I have modified the value of g_fProjectionMatrix[15] whenever xfregs.rawProjection[0] is 2.0f (note: there does not appear to be any other projection layer where xfregs.rawProjection[0] is 2.0f).
Please note: I must admit that I'm not familiar with game or emulator programming and anyone willing to take the time to clarify my thoughts would be much appreciated.