-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Fix and further improve line drawing in Echochrome #15583
Conversation
Fixes issues in Echochrome. Though still doesn't look fantastic.
Hm, I suppose that seems reasonable. Should the height/widget scale also be absolute valued? I should check how this affects Persona... Ridge Racer for example draws lines to a CLUT, which will cause problems if the line is centered since it'll end up (likely) getting filtered. On the PSP, the line definitely biases toward the lower right (well, maybe it's different on a flipped viewport, but I think the bias was in screen space.) So definitely don't want that everywhere. Could have some unexpected consequences. -[Unknown] |
Yeah, since the PSP doesn't have wider lines than 1 pixel, there's no defined way to render them at higher res, we just have to do the best we can when rendering at higher resolutions, and I think for 2D, bottom-right-biasing is the right thing indeed so I don't plan to change the default. Centered lines is only meant as a small nearly-free enhancement for games that look better with it like Echochrome, so it will stay a compat flag. Pretty confident that abs is the right thing for pixel size measurement here as the math just breaks with negative pixel sizes, but I don't think we should do it for other scale factors (not sure exactly which ones you mean..). |
By the way, I'm wondering whether it really makes sense to offset the UVs when making the line wider. Feels like it either wouldn't make much difference, or that we'd rather stretch the same texel across the width of the line rather than risking bringing neighboring ones into the mix... |
…uch better codegen)
I've confirmed that this doesn't break Persona 2. Gonna merge, we can improve other things later. It nicely fixes the Echochrome regression at least, while being fairly safe. (Optimized it a bit, far better codegen from avoiding reading from the destination, and it'll pay back if we one day write directly to GPU memory here). |
I think it makes sense to take the absolute value of the computed pixel sizes. Once that's done, the rest of the math will be correct no matter the space. This fixes the squished lines.
Additionally, centering the thickened lines looks considerably better in this game, so let's add a special compat mode for that, it's not that much code.
We can enable it for any other games that use 3D lines. Doesn't make much sense for upscaled 2D lines though, which is the most common use of lines.
Fixes #15556
Also sneaks in a couple of minor things (gradle upgrade, TODO added)