Replies: 1 comment 5 replies
-
Can you add some screenshots? I'd like to make sure I understand the blurring you mean. Also, this is made trickier due to devicePixelRatio != 1 (it's 2 for retina displays, and e.g. 3.5 for some mobiles). Also, can you repro on browsers other than Chrome or devices other than Mac? This could be a browser bug of some kind too. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We are seeing a (fairly subtle) blurring of the final output, most noticeable on edges, and it seems to be due to non-round pixel dimensions of the canvas.
It looks like this (or a similar) issue has been discussed before:
Details:
As reported by our client, we observe the rendering doesn't look as sharp as a fixed-size viewer that uses round numbers. (This is using latest Chrome, on a Mac, with current 1.12.0 model-viewer)
We are using model-viewer inside a css grid system, which uses percentages for column widths, leading to non-round pixel values for the container and canvas elements:
If we set the parent container to a fixed size (using round pixels values), the blurring issue immediately goes away.
An adequate workaround may be to use (via injected stylesheet):
canvas.show { width: auto !important; height: auto !important; }
This overrides the inline CSS styles and causes the canvas to use the integer width/height attributes for its dimensions (eg
width="691" height="533"
). This does cause some resizing weirdness however, so it's not ideal.tl;dr
It seems to us that the integer canvas width/height attributes (eg
width="691" height="533"
) should be precisely the same for the inline CSS styles for the canvas dimensions.Otherwise having numbers like (eg) 691.6 and 533.6 can lead to "off-by-1" discrepancy on the canvas dimensions, causing scaling to occur which impacts visual quality.
Beta Was this translation helpful? Give feedback.
All reactions