http://bugs.winehq.org/show_bug.cgi?id=11819
Octavian Voicu octavian.voicu@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |octavian.voicu@gmail.com Summary|The longest journey demo: |The Longest Journey Demo: |Depth Stencil buffer |characters rendered |locking not implemented |partially because of | |artifacts in the z-buffer
--- Comment #37 from Octavian Voicu octavian.voicu@gmail.com 2011-11-10 13:23:32 CST --- There are a bunch of issues here:
1. First of all, game uses only one z-buffer (no stencil buffers). It locks it then immediately unlocks it, without ever accessing the memory (probably for some kind of synchronization). I do have an initial implementation of locking/unlocking, but depth/stencil surface code needs to be refactored.
Until that, we need to silence two fixmes (show only once) that pollute the output to make the game playable:
fixme:d3d_surface:surface_load_location Unimplemented location SFLAG_INSYSMEM for depth/stencil buffers. fixme:d3d_surface:surface_unmap Depth / stencil buffer locking is not implemented.
2. The black rendered characters is a lighting-related issue, which I described in http://bugs.winehq.org/show_bug.cgi?id=29052 and also included a patch.
3. Not specifically related to this bug report, but there is another issue with the message box asking whether you want to quit the game showing up completely gray. I have a hack for this in http://bugs.winehq.org/show_bug.cgi?id=28678, but there's much work to be done until a patch is ready for submission.
4. Finally, the partially rendered characters issue is indeed related to the z-buffer, but indirectly. Game uses IDirect3DViewport2::Clear(D3DCLEAR_ZBUFFER) to clear the z-buffer, but the rectangles it clears are wrong. It decides what rectangles need to be cleared in the z-buffer by transforming the bounding box of characters using IDirect3DDevice2::TransformVertices(). Wine's implementation of this method doesn't work when IDirect3DViewport2::SetViewport2() is used to set the viewport. I already tested a hackish patch that solves the issue, and currently working on tests and a proper one.
With patches for 1, 2, 3, 4 graphics are flawless, but didn't test very much yet.
I changed the title of the bug to reflect to be more accurate after my new findings, and will update progress of fixing TransformVertices and conversion between D3DVIEWPORT and D3DVIEWPORT2 here.