[Bug 27264] Silent Hill 2 menu invisible

wine-bugs at winehq.org wine-bugs at winehq.org
Sat Oct 15 10:17:47 CDT 2011


http://bugs.winehq.org/show_bug.cgi?id=27264

Stefan Dösinger <stefan at codeweavers.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |stefan at codeweavers.com

--- Comment #17 from Stefan Dösinger <stefan at codeweavers.com> 2011-10-15 10:17:47 CDT ---
I see why the game is broken now, and why it worked before, but I don't yet
know a proper fix.

The game draws the broken parts of the menu at z = 0.0:
err:d3d:position_float4 Position 471.250000 433.000031 0.000000 1.000000

This is right at the near clip plane. If the z would be any less the geometry
would be discarded. The game sets ZBIAS to 0x00000001, which is supposed to
move the geometry closer to the camera. To get the result in GL we set
glPolygonOffset to -1.0. This does cause the geometry to be clipped by the near
clipping plane.

Prior to my patch this used to work because we interpreted the DWORD value
0x00000001 as float, which is a really tiny value, much smaller than 1.0. This
didn't make sense because even the highest possible ZBIAS(15) would be a way
too small offset, so ZBIAS was essentially disabled prior to my patch. Now that
we give the app what it asks for it breaks.

I'm not sure why it is working on Windows(or supposed to work, didn't test
yet). Most likely it is because it is using pretransformed geometry and ZBIAS
isn't applied in that case. Or ZBIAS is applied after clipping(unlikely). Or a
zbias value of 1 is supposed to be so small that it doesn't have any effect at
all. This will need some tests.

There are some parts of the main menu that still work, e.g. the mouse pointer,
the main menu and the new game menu. Those are drawn at z=0.01. What's not
working is the fade-in/fade-out animation and the text in the options menu.

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the wine-bugs mailing list