ruffle
ruffle copied to clipboard
Extremely thin/zoomed out lines look much thinner in Ruffle than they do in flash player.
There seems to be some subtle rendering difference when drawing extremely small lines. I have a screenshot and demo of the issue:
https://i.imgur.com/fffKIaX.png https://mrcheeze.github.io/detritus/ruffle/zoomout.html
The beginning of this flash contains many lines that are shrunk to be extremely small (you can zoom in with flash player to see their true shape). When rendered in Ruffle, the lines are considerably smaller than a pixel, and so are on the verge of being totally invisible. They also flicker strongly when animated to move around.
In flash player, on the other hand, they render surprisingly thick - it seems to me like they always render at least 1 pixel wide when set to Low quality, half a pixel wide when set to Medium quality, and some other finer fraction of a pixel wide when set to High quality. In all cases, the end result ends up much thicker than what Ruffle itself draws.
I'm not sure if this difference in rendering behaviour is specific to only lines, or reflects some deeper difference between how rendering works between flash player and ruffle.
EDIT: This issue can be tested on the latest nightly release here: https://mrcheeze.github.io/homestuck-ruffle-tester/#A6A6I1,950,750
Done some searching through other issues, this seems to be related to the issue with "hairline" strokes discussed here: https://github.com/ruffle-rs/ruffle/issues/751#issuecomment-648412873
If my understanding is correct, stroke width is clamped to at least 1px before scaling in Ruffle, but after scaling is applied in Flash Player. This seems to match what I'm seeing in the demo above.
(And I think I was mistaken about quality being relevant here, the line itself is 1px in flash player no matter what. It just also has antialiasing applied if the quality is something other than low.)
@MrCheeze, screenshot attached here:
Although this is still broken in the wgpu and webgl render backends, which means it's still broken by default on both desktop and web, it was actually fixed for only the canvas backend in https://github.com/ruffle-rs/ruffle/pull/7042 :
Based on Herschel's comments in that PR, the plan is to eventually make that fix available to the other render backends. But according to n0samu's comments in https://github.com/ruffle-rs/ruffle/issues/9044 , that may not happen any time soon.
https://github.com/ruffle-rs/ruffle/issues/9187 may provide a workaround in the meantime, if implemented.