ruffle icon indicating copy to clipboard operation
ruffle copied to clipboard

Extremely thin/zoomed out lines look much thinner in Ruffle than they do in flash player.

Open MrCheeze opened this issue 4 years ago • 3 comments

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

MrCheeze avatar Dec 13 '20 20:12 MrCheeze

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 avatar Dec 13 '20 21:12 MrCheeze

@MrCheeze, screenshot attached here:

fffKIaX jpg

ousia avatar Jan 28 '21 06:01 ousia

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 :

image

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.

MrCheeze avatar Jan 17 '23 00:01 MrCheeze