-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VertexShaderManager: Add an epsilon hack to the perspective projection. #3448
Conversation
Aside from Sonic Adventure there are noticeable differences in: ogl-lin-intel / sw3-dt |
I doubt this is correct. The real projection matrix should be build only based on the values in rawProjection itself, 0.0f and +-1.0f. In hardware, this is likely a simple multiplication per rawProjection value, and an addition for each 1.0f. |
FifoCI detected that this change impacts graphical rendering. Here are the behavior differences detected by the system:
automated-fifoci-reporter |
@degasus I don't think I understand what you want to say? I mean the entire problem is that the values in the rawProjection seem to be rounded incorrectly. I'll do some more debugging tonight to find out whether this rounding is already present in the raw projection before it is fed to the shader. |
rawprojection is a 1:1 bitwise copy in XF memory, there is no rounding |
@degasus Yeah, so I'll check the XF memory, if there is the same type of rounding there then we can implement a hardware test and see how the hardware handles it. |
@degasus Just checked it, the XF memory has the values in the projection matrix set up for failure. I will write a hardware test to confirm whether the console handles this differently. |
@degasus So we know the console handles clipping differently since we completely fail the gx_clipping test. I've discussed it with @delroth and we think for 5.0 adding a workaround that doesn't cause any regressions is acceptable. After 5.0 is released I'll work on getting Dolphin to pass the gx_clipping test (Note that this PR does nothing to make us pass anything in that test). Do you agree with merging this workaround? |
yeah, workaround for 5.0 sounds fine. By the way, have you already tried to get videosw to pass it? I guess it's a good way to start getting exactly what's on. |
@degasus Not yet, I'll try it tomorrow. |
@dolphin-emu-bot rebuild |
Update on VideoSW attempts? |
VertexShaderManager: Add an epsilon hack to the perspective projection.
This fixes the UI in Sonic Adventure, the cause is that the UI is being drawn at z=-1, but that becomes z=-1.0001 after applying the projection matrix. We need to either compensate for it using this epsilon hack or find a way to fix the actual rounding error.