-
-
Notifications
You must be signed in to change notification settings - Fork 845
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 stroke widths and hairline strokes in wgpu and webgl #9981
base: master
Are you sure you want to change the base?
Conversation
68c2449
to
5be3335
Compare
Can confirm it fixes #1955 ! |
Problems with outlines in next games: Animations: |
Thanks a lot for your work on this. 😉 This PR is a great improvement for all of the Steppenwolf games, for instance Steppenwolf 2-1. There are still some issues that I'm mentioning below. Regression on the canvas renderer - looks wild now: This one is less important but strokes look a bit smoother in Flash Player and in Nightly Ruffle using the canvas renderer: |
What's strange is that the overhead baggage shelf is missing on canvas backend... :D |
Yeah, I noticed that too while posting, seems to be a very old bug (I tried with a release from November 2020 and the issue was already there). |
Thanks so much for your work on this! Some thoughts so far:
Example SWF So the idea of splitting into one stroke part and one fill part doesn't handle all cases; you'd need to at least allow for multiple stroke shapes between multiple fill shapes.
Example SWF Naturally this is a pathological case, but just pointing out the obvious.
This is PR is a huge improvement and the above is me thinking out loud. Sorry if this has already been discussed ad nauseum on Discord, and I'm just out of the loop or completely off-base. 😄 |
@Herschel you're absolutely right and I realized that a while ago which is why I put this back to draft, sorry to make you type all that out 😅 I'm going to redo this with lessons learnt shortly, but trying to make more tests too. Most likely it's going to redo the entire shape but only if there's non scaling strokes involved, otherwise the shape can stay static. And it still only needs to redo the shape once a scale changed, I believe. I think there's room to optimise further after that but we need a lot more tests before I'd feel comfortable, and that feels right to me for a basic start |
This should probably also consider hairline strokes as non-scaling, as these act like non-scaling until the shape is scaled >20x, so I think they'd show the above artifacts as well. Here's a good worst-case example for testing scaled strokes and shapes: Dad 'n Me used some weirdo optimizer to scale the assets way down and then back up, so huge strokes and jaggies in shapes will be very obvious here. (Tom has since fixed this in the SWF on Newgrounds, but this is the original SWF.) DadNMeNg.zip |
This fixes #751 (and probably a lot of other issues that should be tested)
This will come at a performance cost, but the size of that isn't known yet (I can't benchmark right now, PC is unhappy with me).