New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 629522 link

Starred by 3 users

Issue metadata

Status: Fixed
Merged: issue 521364
Owner:
Last visit > 30 days ago
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug



Sign in to add a comment

Unity WebGL content blurry on smaller resolutions

Reported by ste...@unity3d.com, Jul 19 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36

Example URL:
https://files.unity3d.com/stefan/webgl/external_bugs/chrome_blurry/index_resize.html

Steps to reproduce the problem:
1. open https://files.unity3d.com/stefan/webgl/external_bugs/chrome_blurry/index.html
2. open https://files.unity3d.com/stefan/webgl/external_bugs/chrome_blurry/index_resize.html
3. compare the content and look for crispness/blur 

What is the expected behavior?
The content should look the same no matter size.

It works well on Firefox and Edge.

What went wrong?
The content looks blurry compared to the other resolution and compared to other browsers with the same resolution (see attached picture).

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? No 

Does this work in other browsers? Yes 

Chrome version: 51.0.2704.106  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 22.0 r0

You can built the linked project yourself if needed using the latest Unity editor and this free package https://www.assetstore.unity3d.com/en/#!/content/32351
 
chrome_blurry_compare.png
146 KB View Download
Components: -Blink Blink>WebGL

Comment 2 by kbr@chromium.org, Jul 20 2016

Components: Blink>Canvas Internals>Compositing
Status: Untriaged (was: Unconfirmed)
Can see the behavioral difference between Chrome Canary and Firefox Nightly on Windows.

I don't think this is a WebGL specific problem, but more likely a problem in how Unity is resizing the canvas. Is it possible that you are causing it to be non-pixel-aligned during layout?

Is there any way you could produce a smaller test case? While we appreciate any test case, this one is far from minimal.

Comment 3 by kbr@chromium.org, Jul 22 2016

Owner: jaydasika@chromium.org
Status: Assigned (was: Untriaged)
Jayadev, do you have experience in determining exactly where layers ended up in the layer tree? If so, could you help confirm whether the canvas is ending up on a fractional offset?

Comment 4 by vmi...@chromium.org, Jul 25 2016

Cc: vollick@chromium.org enne@chromium.org
Cc: jaydasika@chromium.org
Owner: kbr@chromium.org
Re #3: Yes, the canvas layer is ending up with fractional offset. Assigning the bug to you as I don't know what the next step is here.

Comment 6 by ste...@unity3d.com, Jul 28 2016

A smaller test case if that is still needed:
http://files.unity3d.com/stefan/webgl/external_bugs/chrome_blurry2/index.html

Attached the Unity project itself.

Stays sharp all the time in FF and Edge.

chrome_blurry2.zip
922 KB Download

Comment 7 by ste...@unity3d.com, Jul 28 2016

Forgot to mention:
1) run in chrome
2) start resizing browser window
3) notice it gets blurred at certain sizes

Comment 8 by kbr@chromium.org, Aug 2 2016

Cc: jo...@unity3d.com kbr@chromium.org
Owner: jaydasika@chromium.org
Jayadev: how did you figure out that the canvas is getting a fractional offset? Can you please offer the developer any advice on how to avoid this happening?

I can't repro yet, but my guess is that this is a composited layer with a fractional
translation. It might be the

transform: translate(-50%, -50%);

CSS, which if the # of pixels in the viewport is odd, will not be integral.

trchen is working on this issue, see issue 521364.

In general, it's a good idea to make sure transforms use integer coordinates when
possible.
Mergedinto: 521364
Status: Duplicate (was: Assigned)
yes, I have verified that this is a composited layer with a fractional translation.
Status: Assigned (was: Duplicate)
De-duplicating as 521364 is only fixing it for picture layers. I haven't yet verified its a  picture layer.
Status: Duplicate (was: Assigned)
The layer with fractional translation is picture layer.

Comment 13 by enne@chromium.org, Aug 9 2016

Cc: trchen@chromium.org
Status: Available (was: Duplicate)
Unduping.  This is WebGL and it creates a texture layer that has a fractional translation.  I suspect it is the case that this example also has some parent picture layer that also has a fractional translation.

The other bug has a webgl compositing trigger but is not webgl related in the same way that this bug is.

Fixing PictureLayer rasterization on its own to not be blurry will not fix this webgl case.  It might be worth trying to think about how to solve both of them, maybe needing a setting on a layer to pixel snap it and pass the offset to the layer to use for rasterization if it's a picture layer.

Comment 14 by kbr@chromium.org, Sep 2 2016

Status: Assigned (was: Available)

Comment 15 by kbr@chromium.org, Sep 22 2016

Labels: -Pri-2 ReleaseBlock-Stable M-56 Pri-1
I'd like this to receive some attention. This was reported by an important customer (Unity) and their content needs to look good across all devices. Upgrading to P1 and scheduling for M56. If this can be investigated and fixed earlier, even better.

Comment 16 by enne@chromium.org, Oct 7 2016

jaydasika: could you update this P1 with its progress, please?
Re #16 : Haven't made progress on this so far. I am currently working on another P1 that needs to be merged to M55. Will get to this after that.

Comment 18 by ajha@chromium.org, Oct 17 2016

Friendly ping to get an update on this.
Status: Started (was: Assigned)
Project Member

Comment 20 by bugdroid1@chromium.org, Oct 26 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2a1718bffdb1d3c9538731498382e9aafd886ceb

commit 2a1718bffdb1d3c9538731498382e9aafd886ceb
Author: jaydasika <jaydasika@chromium.org>
Date: Wed Oct 26 22:58:02 2016

cc : Snap texture layers to pixel boundary

This is to avoid blurring caused by fractional translation.

BUG= 629522 
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel

Review-Url: https://codereview.chromium.org/2451273003
Cr-Commit-Position: refs/heads/master@{#427859}

[modify] https://crrev.com/2a1718bffdb1d3c9538731498382e9aafd886ceb/cc/layers/layer.cc
[modify] https://crrev.com/2a1718bffdb1d3c9538731498382e9aafd886ceb/cc/layers/layer.h
[modify] https://crrev.com/2a1718bffdb1d3c9538731498382e9aafd886ceb/cc/layers/layer_impl.cc
[modify] https://crrev.com/2a1718bffdb1d3c9538731498382e9aafd886ceb/cc/layers/layer_impl.h
[modify] https://crrev.com/2a1718bffdb1d3c9538731498382e9aafd886ceb/cc/layers/texture_layer.cc
[modify] https://crrev.com/2a1718bffdb1d3c9538731498382e9aafd886ceb/cc/layers/texture_layer.h
[modify] https://crrev.com/2a1718bffdb1d3c9538731498382e9aafd886ceb/cc/layers/texture_layer_impl.cc
[modify] https://crrev.com/2a1718bffdb1d3c9538731498382e9aafd886ceb/cc/layers/texture_layer_impl.h
[modify] https://crrev.com/2a1718bffdb1d3c9538731498382e9aafd886ceb/cc/proto/property_tree.proto
[modify] https://crrev.com/2a1718bffdb1d3c9538731498382e9aafd886ceb/cc/trees/layer_tree_host_common_unittest.cc
[modify] https://crrev.com/2a1718bffdb1d3c9538731498382e9aafd886ceb/cc/trees/property_tree.cc
[modify] https://crrev.com/2a1718bffdb1d3c9538731498382e9aafd886ceb/cc/trees/property_tree_builder.cc
[modify] https://crrev.com/2a1718bffdb1d3c9538731498382e9aafd886ceb/cc/trees/property_tree_unittest.cc
[modify] https://crrev.com/2a1718bffdb1d3c9538731498382e9aafd886ceb/cc/trees/transform_node.cc
[modify] https://crrev.com/2a1718bffdb1d3c9538731498382e9aafd886ceb/cc/trees/transform_node.h

Status: Fixed (was: Started)
Cc: hdodda@chromium.org
Labels: Needs-Feedback
Tested the issue on Windows 10 using Chrome Dev M56 # 56.0.2902.0:

Navigated to https://files.unity3d.com/stefan/webgl/external_bugs/chrome_blurry/index_resize.html and below are the observations

1. Changed the system resolution to 3840* 2160 and observed no blurry contents.
2. Zoomed in the browser till 60 % and Zoomed out till 300 % and did not observe any blurry contents.

Attaching a screenshot comparing with Firefox for further reference.
Please let me know whether this is the intended behavior and update the issue which would help us in further triaging.

Thanks !


629522.png
1.1 MB View Download

Comment 23 by kbr@chromium.org, Oct 27 2016

Cc: ajuma@chromium.org
See also follow-on CLs that didn't reference this bug (but should have):

https://codereview.chromium.org/2451383003
https://codereview.chromium.org/2459613003/

Re #22 : The screenshot you attached is for https://files.unity3d.com/stefan/webgl/external_bugs/chrome_blurry/index.html which doesn't have the bug. This issue fixes bluriness on https://files.unity3d.com/stefan/webgl/external_bugs/chrome_blurry/index_resize.html , I have checked on ToT and it looks fixed (looks same as Firefox) to me.
Project Member

Comment 25 by bugdroid1@chromium.org, Oct 28 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/679b26ff61f303d85a56f5df1fd6199f209ad7ca

commit 679b26ff61f303d85a56f5df1fd6199f209ad7ca
Author: ajuma <ajuma@chromium.org>
Date: Fri Oct 28 02:14:49 2016

Correctly rebaseline 2DCanvasWebGL pixel test

This is a follow-up to http://crrev.com/2451383003, which updated
an obsolete file.

BUG= 629522 , 660118 

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
NOTRY=true

Review-Url: https://codereview.chromium.org/2459613003
Cr-Commit-Position: refs/heads/master@{#428245}

[modify] https://crrev.com/679b26ff61f303d85a56f5df1fd6199f209ad7ca/content/test/gpu/gpu_tests/pixel_expectations.py
[modify] https://crrev.com/679b26ff61f303d85a56f5df1fd6199f209ad7ca/content/test/gpu/gpu_tests/pixel_test_pages.py

Project Member

Comment 26 by bugdroid1@chromium.org, Oct 28 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7ca50e2014e8987c6a4d5e74d39be65893c91837

commit 7ca50e2014e8987c6a4d5e74d39be65893c91837
Author: ajuma <ajuma@chromium.org>
Date: Fri Oct 28 15:47:07 2016

Remove failure expectation for 2DCanvasWebGL pixel test

The reference images have been regenerated and the test is now
passing.

TBR=kbr@chromium.org

BUG= 629522 , 660118 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2458073002
Cr-Commit-Position: refs/heads/master@{#428383}

[modify] https://crrev.com/7ca50e2014e8987c6a4d5e74d39be65893c91837/content/test/gpu/gpu_tests/pixel_expectations.py

Sign in to add a comment