Skip to content
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

Software renderer off-by-one errors #4853

Closed
unknownbrackets opened this issue Dec 16, 2013 · 7 comments · Fixed by #8282
Closed

Software renderer off-by-one errors #4853

unknownbrackets opened this issue Dec 16, 2013 · 7 comments · Fixed by #8282

Comments

@unknownbrackets
Copy link
Collaborator

The software renderer has several off by one errors, I'm not sure if they're in UV handling or drawing.

Here's one example from Wild Arms XF (alternating between GLES and softgpu - you can see where the triangles aren't matching up or something):

softgpu-off-wildarms

Here's another from Hexyz Force intro (the texture is actually 512x32, slices):

softgpu-off-hexyz

-[Unknown]

@thedax
Copy link
Collaborator

thedax commented Dec 17, 2013

Possibly related: FF4's text boxes and some backgrounds/sprites tend to "bounce around" by one pixel or so in GLES mode, when HW transform is on, like the first gif you posted.

@unknownbrackets
Copy link
Collaborator Author

Well, this is only regarding the software renderer, not GLES. I believe GLES is mostly correct here - there's a separate bug for that (and it's actually affected by the vertex cache too iirc.)

-[Unknown]

@thedax
Copy link
Collaborator

thedax commented Dec 17, 2013

I know it's for software, I was just seeing if there was a possible connection in how both handle these things.

@unknownbrackets
Copy link
Collaborator Author

The examples I have are all nearest, and if bilinear is forced on, it doesn't happen. This is likely just missing a half-pixel offset (per @hrydgard), which makes sense.

-[Unknown]

@unknownbrackets
Copy link
Collaborator Author

So, it's got a formula like this for the logo:

s = (0.85937500 * 1.0 * 180224 + 0.62109375 * 1.0 * 7168 + 0.62109375 * 1.0 * 62464) / 249856.0;

The result is meant to come to 0.79296875 (406/512), but instead comes to 0.79296869 due to loss of precision.

The other screen has more issues than just the face (text too.) Forcing linear fixes them too but also breaks some other things.

I tried adding small portions but I couldn't find anything that made sense and didn't break anything else...

-[Unknown]

@unknownbrackets
Copy link
Collaborator Author

unknownbrackets commented Apr 23, 2017

Reopening this - still a rounding issue in throughmode. It's because the w values as floats are too inaccurate.

Easily seen in Crisis Core.

-[Unknown]

@unknownbrackets
Copy link
Collaborator Author

This was fixed more correctly in #9673. I'm still not sure it's perfect, but the Crisis Core and other cases are now working right.

-[Unknown]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants