-----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.
On 31 January 2011 15:45, Stefan Dösinger stefandoesinger@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@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.
2011/1/31 Stefan Dösinger stefandoesinger@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@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.
2011/1/31 Stefan Dösinger stefandoesinger@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).