xemu icon indicating copy to clipboard operation
xemu copied to clipboard

nv2a: Offset vertices to match HW rounding

Open antangelo opened this issue 2 years ago • 9 comments

This is a continuation of the work done in #735 . Hardware will round vertices at 0.5625 instead of OpenGL's 0.5.

The approach taken in this PR shifts each vertex up and to the left by 0.0625, so that the HW rounding point 0.5625 is mapped to 0.5. A small bias is then added based on whether the subpixel was above or below the boundary, to correct for precision errors. This passes all but one of the test cases that abaire made (specifically, the projected adjacent geometry test with a bias of 0.5625 is not entirely matching HW), which is why I'm leaving it in draft for now.

This approach does not work at resolution scales higher than 1x. I'm not sure that there is a general solution that both works above 1x and does not introduce z-fighting or flickering.

Known Issues:

  • [ ] Morrowind Water

antangelo avatar Jan 22 '23 09:01 antangelo