Re: wined3d: Update clip planes when switching to/from offscreen rendering.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 31.01.2011 um 15:13 schrieb Matteo Bruni:
It should fix http://bugs.winehq.org/show_bug.cgi?id=25877 <0001-wined3d-Update-clip-planes-when-switching-to-from-offs.txt> If we change the shader code to write gl_ClipVertex and result.clip before applying the y inversion then we should be able to avoid this. That should also make it more compatible to fixed function vertex processing - here the clipping is performed before the projection matrix is applied.
-----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) iQIcBAEBAgAGBQJNRssNAAoJEN0/YqbEcdMwZv8P+wbbhcamRsg42fMzJ02jKLcT s4p19OqKPZEdVvzsfQCe4e7KGgGdZUefMWsY2ib9AK21cQXB3R9fnyl5TMDcuxuh EojJvAQCVd/hgnz7tserUJT6rS/W08BPsdHM4dgxdnhRTzi2FAc7l3NgFOONJXpG i8HfcmD2AgaGOam6Wriv3SD8fM0zrfmpZdJDH1moCefqptEEWD9adwWRSMhaMvTl rlj1gDR9cRC9fsxur2U1f5NuXN0AY+a+5VPQHElZV2bP9ulheoa9nYuXU+8F7OhK RyIJ2DO4vpaLpEbXW/amtUWnlBSk0n7k3F9w/fcthOmUvlPHOBY7i2Ukf4j84vQD AhpN7Yf4cFZaSV8q/gww+U9H1udelidiTEL05OKQJUohnM1F9/cRnXbXmmA5Nuia rQlcCnm12cw1ClykdrY7B/hDCqGOPnnmPp580kW1LlEtidYyGbG35seyHxNqcNcQ RWlvVsGwvlzgex7qWf9hT34KOcUzMKZdlehfvtQn0Fjrcf+/3s5EvrtG4Mw6qHNh aBFNaeB8LkV36hu71r/1yxsqHO+taYt1/Ho8poANYbOplV9FCpd0nXeK8n7rqCPx L5TVgSJVd4n354FlguuIUAiFlXxcxFN2CJlN2Hd4dwhZZhGBh+4LH+XhjUtzX4ge 15usBq4VUhhssvv6dVys =urcm -----END PGP SIGNATURE-----
On 31 January 2011 15:45, Stefan Dösinger <stefandoesinger(a)gmx.at> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 31.01.2011 um 15:13 schrieb Matteo Bruni:
It should fix http://bugs.winehq.org/show_bug.cgi?id=25877 <0001-wined3d-Update-clip-planes-when-switching-to-from-offs.txt> If we change the shader code to write gl_ClipVertex and result.clip before applying the y inversion then we should be able to avoid this. That should also make it more compatible to fixed function vertex processing - here the clipping is performed before the projection matrix is applied.
Wouldn't it still have to be after the half-pixel offset is applied though?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 31.01.2011 um 15:57 schrieb Henri Verbeet:
On 31 January 2011 15:45, Stefan Dösinger <stefandoesinger(a)gmx.at> wrote:
If we change the shader code to write gl_ClipVertex and result.clip before applying the y inversion then we should be able to avoid this. That should also make it more compatible to fixed function vertex processing - here the clipping is performed before the projection matrix is applied.
Wouldn't it still have to be after the half-pixel offset is applied though? That's what I am not sure about, but my gut feeling says no. In the ffp pipeline clipping wrt user clip planes is done in eye coordinates, so the half pixel offset should have no effect on it. I see no reason why it shouldn't work with shaders in the same way.
-----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) iQIcBAEBAgAGBQJNRtD8AAoJEN0/YqbEcdMwVOUP/1x8ZB6vutkspZU2fhspi1tE s+b1drKBfHMu3LxswKwo/tA+xB/3h+qyKLuo6GT0kqQ+kF4IbFE3No1oX//baRDn 9eWYke1dz/Q0Jh6K1dA72moptYvbpplgvjr4/8bnBCFGChkbQsaK2O0o6zxFtIXc yeTxB+oymu0tNxLXzJn+nrOT3qMp1yN9c/MX7crK7O0B56RAUTTg8P4i2Zz4r9L8 WBHQ8sGGBtpeN9lf65MZeJNZvchLrWsJjq5iDvGxl1vRVuEsMzMEM7xqosOeQgul dFlYQFRTNxQk0XCdprq2jIdc/HiZANjvXO7U0eBiV6Orjo91Rbjtg2UCr43Q3hQH wdtoXYyPRbCuvttEpnQBg6vg/UegTGIqKNl2QynN/wFocoJ/2FX+aNC49KGnrhEj RzUCPuLuQ4y2DqX5zqggnbmrFPHke2Gbz4RJZy085X+FbKGpWen3o+iZCK2rX294 8nrlfO1JEGu2Gay+gqUJUQFUhdI1DRr0i5c+Lw7sLztqTZDeGt4/Al+wEDmkS1XA lRJVdOtib+BtBzXB2k9H5vawJt2xmqxSmMfjBu7tvkdoINISmDRNHZoow/Io2sid P2ZYNXt1AFnRFrvtC5CMLkTYEqMhh5/mcAzrmsVVD8WR4mwAR8dGUMCH17R3+C3L P9sP1J5E/M1B9Yx5YV8M =gL/E -----END PGP SIGNATURE-----
2011/1/31 Stefan Dösinger <stefandoesinger(a)gmx.at>:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 31.01.2011 um 15:57 schrieb Henri Verbeet:
On 31 January 2011 15:45, Stefan Dösinger <stefandoesinger(a)gmx.at> wrote:
If we change the shader code to write gl_ClipVertex and result.clip before applying the y inversion then we should be able to avoid this. That should also make it more compatible to fixed function vertex processing - here the clipping is performed before the projection matrix is applied.
Wouldn't it still have to be after the half-pixel offset is applied though? That's what I am not sure about, but my gut feeling says no. In the ffp pipeline clipping wrt user clip planes is done in eye coordinates, so the half pixel offset should have no effect on it. I see no reason why it shouldn't work with shaders in the same way.
The attached patch should follow your idea, does it look right? FWIW, I can't see any 1-pixel offset in The Sims 3 with this patch. Yes, I know that's not how it should be tested...
-----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
iQIcBAEBAgAGBQJNRtD8AAoJEN0/YqbEcdMwVOUP/1x8ZB6vutkspZU2fhspi1tE s+b1drKBfHMu3LxswKwo/tA+xB/3h+qyKLuo6GT0kqQ+kF4IbFE3No1oX//baRDn 9eWYke1dz/Q0Jh6K1dA72moptYvbpplgvjr4/8bnBCFGChkbQsaK2O0o6zxFtIXc yeTxB+oymu0tNxLXzJn+nrOT3qMp1yN9c/MX7crK7O0B56RAUTTg8P4i2Zz4r9L8 WBHQ8sGGBtpeN9lf65MZeJNZvchLrWsJjq5iDvGxl1vRVuEsMzMEM7xqosOeQgul dFlYQFRTNxQk0XCdprq2jIdc/HiZANjvXO7U0eBiV6Orjo91Rbjtg2UCr43Q3hQH wdtoXYyPRbCuvttEpnQBg6vg/UegTGIqKNl2QynN/wFocoJ/2FX+aNC49KGnrhEj RzUCPuLuQ4y2DqX5zqggnbmrFPHke2Gbz4RJZy085X+FbKGpWen3o+iZCK2rX294 8nrlfO1JEGu2Gay+gqUJUQFUhdI1DRr0i5c+Lw7sLztqTZDeGt4/Al+wEDmkS1XA lRJVdOtib+BtBzXB2k9H5vawJt2xmqxSmMfjBu7tvkdoINISmDRNHZoow/Io2sid P2ZYNXt1AFnRFrvtC5CMLkTYEqMhh5/mcAzrmsVVD8WR4mwAR8dGUMCH17R3+C3L P9sP1J5E/M1B9Yx5YV8M =gL/E -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 31.01.2011 um 17:08 schrieb Matteo Bruni:
The attached patch should follow your idea, does it look right? FWIW, I can't see any 1-pixel offset in The Sims 3 with this patch. Yes, I know that's not how it should be tested... Looks OK on first sight. Does it work as well?
I can't think of any game where you could see a half pixel issue wrt clipplanes. Maybe the d3d7 clipping example can shows something, but I think to be sure you'd have to write a test. The half pixel offset is mostly visible when games draw text by drawing textured quads, e.g. the menu and console in the source engine. Another odd occurrence is in Spore, where the game draws some heightmaps and reads them back. With incorrect half pixel offsets the in-game world is suddenly full of high walls. Then there's Warhammer Online which draws floor tiles in offscreen textures, leading to odd lines in the floor when they are not drawn properly. -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) iQIcBAEBAgAGBQJNRub1AAoJEN0/YqbEcdMwAA4P/AoF12KxCyW/L7K1FV4EOKoz HDKpNZ4D1dOPf35JJuZaVOuEqh7AJrmp9QSorgF0kFkdEAr7bHaBnGuSny+STEMi zDfW1VdeKAwVbfuQCjVP3FwKMkw/K5Olg5U9D+CBIIAaPG2A2PSoV3FPjtQ2RJ8s K8so7GqlgqcSEPc6TXD0ngS1jTmRVpTqCzX3wDbGTM6jO7lqoajngdYoXGcVVR+j vYiWVXHXOhnmqTD48xw7uqKTEwd9+zseAXZVWSVL3Rk+l0pdvT8pfPNUguKrqipx MizDRGT6iw2f3/7lrePacbLzGnxhH4DACIgJnoBjvZdfrtXFezuJFz7kIHy/XqyE EXUCF/2SDqFYCTnFtBgSL6u/4xGhoIw1tj7pnzrLN+wzqx+VWfndquj5+rTEoNFK FxY0X/6bLPSaUDs6J9GjzwFQ1j5XTr6ebFcwtGvCsADx4IHiUO0/d1WdafNoMpH5 /YWC2Spa+OXe9dWwNR/4XqQny+KAFEIfnqZJGTp/8Ak7rGIhIVgmUqxcklp2p0hb qwgtD79uaW4tOQnLQcOV2F4JxW0HdOb4yKtoinPskIcw234TegfHFr6MKgEjl9Mi kFmYS3CHfd9ABC+YSB17KYu93S3t3KI4YuYcftuf06czFAXue9c6P8VwzjAfmM5l KoFYrEBo518k3bgtMpPr =4Ham -----END PGP SIGNATURE-----
2011/1/31 Stefan Dösinger <stefandoesinger(a)gmx.at>:
Am 31.01.2011 um 17:08 schrieb Matteo Bruni:
The attached patch should follow your idea, does it look right? FWIW, I can't see any 1-pixel offset in The Sims 3 with this patch. Yes, I know that's not how it should be tested... Looks OK on first sight. Does it work as well?
It seems to work. :)
I can't think of any game where you could see a half pixel issue wrt clipplanes. Maybe the d3d7 clipping example can shows something, but I think to be sure you'd have to write a test.
Is the test I attached a good way to check for that? I could send this test to wine-patches too (or a fixed version if it happens to be broken).
participants (3)
-
Henri Verbeet -
Matteo Bruni -
Stefan Dösinger