-
Notifications
You must be signed in to change notification settings - Fork 171
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
backgroundColor not working in html for Chrome #525
Comments
Are you running Chrome over Ubuntu? I have the same issue, but not just this one. The trajectories don't work properly, nor some representations like surfaces. As I said, it just happens in Chrome (and Chromium) over Ubuntu (14.04 in my case). Some of my co-workers have similar issues with NGL View. Before that, it happened after every Chrome update, but I fixed it just resetting WebGL through chrome://flags. But after updating to the version 64 or 65, this option disappeared, so I tried with a plugin, but this trick doesn't fix the bug anymore. It seems more a problem with WebGL / Ubuntu compatibility. |
Yes I use the same Ubuntu config. |
Anybody knows how to fix that? Some google chrome trick? |
Are you running Chrome on Ubuntu? In my case: Chrome 67, Ubuntu 14.04 and the background is always black. Chrome on mac works properly (as Safari). Firefox works perfect in both OS. |
I tested on a Mac. My first idea about linux is that is is a graphics driver issue. |
Thanks Alexander. So there is nothing to do but wait for a fix from Chrome? |
Or maybe update gpu drivers |
Is this related to this? When I execute the following code, the color of the background is changing but I'm loosing transparency:
If I change the second parameter of the setClearColor method from 1 to 0, the behavior is similar to the one observed while using:
However changing ThreeJS scene background works well: But it required me to add the ThreeJS dependency to my project. Thanks |
Hi David, The code below fix the background color issue but in my case (Chrome on Ubuntu), the 3D representation disappears when I interact with it.
By the way, I have experiencied the same issue in Safari mobile. |
@gbayarri: it's because the second parameter of setClearColor controls transparency. So when setting to 1 we loose transparency and thus it makes the representation disappears. Have you tried the second workaround? |
@david-bouyssie: yes, with TREE is working, thanks! But just with static representations. When I try to represent a trajectory the background changes, but the molecules remain at the first position while the bonds move properly. I thought this issue was related with the background one because it only happens in the same cases I can't change the background (in my case chrome on ubuntu and safari mobile). Is it related? |
@gbayarri: I'm afraid I can't help more than that because I'm not an NGL developer. Sorry ;-) |
does |
Yes, it changes the background, but the problem with the trajectories persists. Anyway, I have updated from Ubuntu 14 to Ubuntu 18 and with 18 it works perfect. I don't know what happens with Ubuntu 16, but as you said it seems a problem with the drivers on some (old) OS. |
I'm affected by this problem on Ubuntu 21.04 with Chrome 93 using XOrg display server. |
After an upgrade and restart it seems to work fine for me now on Chrome 94 when using "System title bars and borders" (not sure if this is related). |
Thanks for the data points @krassowski. If there's a solid way to reproduce we could dig a bit more, but if it's a transient thing it's pretty hard to know where to start! |
No worries, I was just trying to leave trace in case someone gets bitten again in future to help to triangulate the issue. There is more discussion in nglviewer/nglview#948 (comment). |
Hi I don't know if I am doing anything wrong but I am trying to change the backgroundColor of the stage like this:
var stage = new NGL.Stage( "viewport", {backgroundColor:'grey'} );
it works in codepen and Mozilla and Opera but not when I open the website with Chrome.
For all I use this CDN:
https://cdn.rawgit.com/arose/ngl/v2.0.0-dev.31/dist/ngl.js
The text was updated successfully, but these errors were encountered: