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

Make the blur filter more accurate (Close #19516) #19645

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

xrtxn
Copy link

@xrtxn xrtxn commented Feb 27, 2025

Fixes #19516
Honestly, I got really lucky to find this. I would love to see how this affects other flash projects.

@xrtxn xrtxn changed the title Make the blur filter more accurate Make the blur filter more accurate (Close #19516) Feb 27, 2025
@xrtxn
Copy link
Author

xrtxn commented Feb 27, 2025

Should I rewrite the tests? They look fine visually, but obviously they fail.

@kjarosh
Copy link
Member

kjarosh commented Feb 27, 2025

Thanks for your contribution! I think we need a test that proves this behavior (which will differentiate between 2.0 and 1.99). How did you get the value 1.99?

Should I rewrite the tests? They look fine visually, but obviously they fail.

Depends on the test. Generally we require an output from Flash Player, but some outputs might be generated from Ruffle, not FP (e.g. shumway tests that are animated).

I'll try looking into it and proposing something.

@kjarosh kjarosh added A-rendering Area: Rendering & Graphics filter-effects Issues involving filter effects such as Blur, Glow, etc. T-fix Type: Bug fix (in something that's supposed to work already) labels Feb 27, 2025
@xrtxn
Copy link
Author

xrtxn commented Feb 27, 2025

I just tested it with a color picker. I tested multiple values, 1.9 was inaccurate, 1.99 looked like a good value to me. I created an example, you can check out https://github.com/xrtxn/ruffle_bug_report master or the old branch.
What was noticable to me, even with strength 1 the middle of the blurred image is #FBFEFB while with the flash player it is #FFFFFF. And the greater the strength was, the bigger the difference.
With this change, the ruffle behavior is #FFFFFF correctly.

@torokati44
Copy link
Member

That 2 right there is in the "spatial dimension", so to say. I'd look for (or put) this slight adjustment somewhere else. Perhaps a floor call should be added somewhere later on the color values...?

@kjarosh
Copy link
Member

kjarosh commented Feb 27, 2025

Yeah, changing 2 to 1.99 does not fully fix the issue, as it still appears for different window sizes. It's most probably a rounding / numerical stability issue somewhere.

@xrtxn xrtxn marked this pull request as draft February 27, 2025 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rendering Area: Rendering & Graphics filter-effects Issues involving filter effects such as Blur, Glow, etc. T-fix Type: Bug fix (in something that's supposed to work already)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Glowfilter implementation is inaccurate
3 participants