Skip to content
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

Shader errors on some platforms (was: warning message when using graphjs) #59

Open
jzicker opened this issue May 19, 2017 · 13 comments
Open

Comments

@jzicker
Copy link

jzicker commented May 19, 2017

attempting example of graphjs and get this warning

g <- graphjs(LeMis, main="Les Misérables", showLabels=TRUE)
print(g)
Warning message:
In structure(x, class = unique(c("AsIs", oldClass(x)))) :
Calling 'structure(NULL, *)' is deprecated, as NULL cannot have attributes.
Consider 'structure(list(), *)' instead.

This was for previous version of threejs. I installed 0.3 and now the viewer in RStudio shows nothing. I tried the same in R and got the same results in the browser

@bwlewis
Copy link
Owner

bwlewis commented May 23, 2017

This is working for me with the latest master branch and R version in both command line R and RStudio (details below).

library(threejs)
data(LeMis)
g <- graphjs(LeMis, main="Les Misérables", showLabels=TRUE)
print(g)

R.version
## ... R version 3.4.0 (2017-04-21)

packageDescription("threejs")
## ...
## Version: 0.3.0
## GithubRepo: rthreejs
## GithubUsername: bwlewis
## GithubRef: master
## GithubSHA1: 6d7c9aaddb02d0010b864adb4398d64c7a1fc591

Can you provide details on R.version and threejs version? Thanks.

@jzicker
Copy link
Author

jzicker commented May 24, 2017

Thanks for looking into this. I was running a previous version of threejs. I changed to version 0.3.0 and it now completes but shows no graph in the RStudio window. I'm guessing it is my environment but struggling to debug what is wrong. here are the versions I am running

R.version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 4.0
year 2017
month 04
day 21
svn rev 72570
language R
version.string R version 3.4.0 (2017-04-21)

packageDescription("threejs")
Package: threejs
Type: Package
Title: Interactive 3D Scatter Plots, Networks and Globes
Description: Create interactive 3D scatter plots, network plots, and globes using the 'three.js'
visualization library ("http://threejs.org").
Version: 0.3.0
Date: 2017-04-26
Authors@R: c( person("B. W.", "Lewis", role=c("aut","cre"), email="[email protected]"),
person(given="Three.js authors", role="cph", comment="three.js JavaScript library"),
person("Alexey", "Stukalov", role=("ctb"), email="[email protected]"), person("Yihui","Xie",
role=("ctb"), email="[email protected]"), person("Andreas", "Briese", role=("ctb"),
email="[email protected]"), person("B.", "Thieurmel", role=("ctb"), email="[email protected]")
)
URL: http://bwlewis.github.io/rthreejs
BugReports: https://github.com/bwlewis/rthreejs/issues
License: MIT + file LICENSE
Depends: R (>= 3.0.0), igraph (>= 1.0.0)
Imports: htmlwidgets (>= 0.3.2), base64enc, stats
Suggests: htmltools (>= 0.2.6), maps
Enhances: knitr, shiny
RoxygenNote: 6.0.1
Author: B. W. Lewis [aut, cre], Three.js authors [cph] (three.js JavaScript library), Alexey Stukalov [ctb],
Yihui Xie [ctb], Andreas Briese [ctb], B. Thieurmel [ctb]
Maintainer: B. W. Lewis [email protected]
Built: R 3.4.0; ; 2017-05-24 12:50:45 UTC; windows
RemoteType: github
RemoteHost: https://api.github.com
RemoteRepo: rthreejs
RemoteUsername: bwlewis
RemoteRef: master
RemoteSha: 6d7c9aa
GithubRepo: rthreejs
GithubUsername: bwlewis
GithubRef: master
GithubSHA1: 6d7c9aa

@bwlewis
Copy link
Owner

bwlewis commented May 24, 2017

OK, I can replicate this on Windows, thanks. Working on a fix...

@bwlewis
Copy link
Owner

bwlewis commented May 24, 2017

Ugh. Found the problem. I'm using EcmaScript 6 and in particular the spread operator (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe erence/Operators/Spread_operator) which apparently is not supported by RStudio yet on all platforms (it seems to work for me on Linux!). (See, for instance, https://github.com/bwlewis/rthreejs/blob/master/inst/htmlwidgets/scatterplotThree.js#L439 and elsewhere in the code).

@jjallaire you may find this bug interesting!

Working on re-writing this now...

@bwlewis
Copy link
Owner

bwlewis commented May 24, 2017

I see another serious problem rendering on RStudio on Windows--I'm getting GLSL shader errors like:

THREE.WebGLShader: gl.getShaderInfoLog() vertex WARNING: 0:2: '' :  #version directive missing
ERROR: 0:60: 'const' : overloaded functions must have the same parameter qualifiers 

This might be one of those dumb OpenGL/DirectX problems in Windows. Working on that...

@jzicker
Copy link
Author

jzicker commented May 24, 2017

Wow. Thanks for putting all the effort in on this. I'm looking forward to showing my colleagues (network medicine project) a network visualization using threejs. I'll make sure to mention your efforts

@bwlewis
Copy link
Owner

bwlewis commented May 24, 2017

Also, if you "pop out" the plot into a browser window (with the little "show in new window" button) it should work. The issue is inside the WebGL interface in RStudio.

@jzicker
Copy link
Author

jzicker commented May 24, 2017

pop out did work! Awesome. I was using zoom from RStudio which of course gave the same blank screen. I can make progress with that as a work around for now.

@bwlewis bwlewis added the bug label May 24, 2017
@bwlewis bwlewis changed the title Warning Message when using graphjs Shader errors on some platforms (was: warning message when using graphjs) May 24, 2017
@bwlewis
Copy link
Owner

bwlewis commented May 24, 2017

These shader errors only occur in RStudio as far as I can tell.

@jjallaire or @ramnathv if you know someone interested in helping on this, let me know.

Things (mostly) work in RStudio on Linux:

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) RStudio Safari/538.1 Qt/5.4.0

but not at all on Windows:

Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/538.1 (KHTML, like Gecko) rstudio Safari/538.1 Qt/5.4.1

@jjallaire
Copy link

I don't offhand.

We're hoping to update our version of QtWebKit but we are waiting on Qt 5.9 (or perhaps 5.10). Should be around the end of this year.

@jzicker
Copy link
Author

jzicker commented May 24, 2017

a little more information. pop out works when default browser is chrome. when default browser is microsoft edge same blank page as in RStudio viewer.

@bwlewis
Copy link
Owner

bwlewis commented May 24, 2017 via email

@bwlewis
Copy link
Owner

bwlewis commented Jun 25, 2017

I can't fix this--errors are happening with even default threejs shaders. The issues are in the various implementations of WebGL used by the target. For instance the QtWebKit version used by RStudio right now on Windows will not work. Thus, RStudio on Windows won't be supported directly until that is updated.

The work around for now is to pop out the plot, or perhaps better, to run RStudio server instead of the desktop application.

I will leave this open with a "help wanted" tag in case someone with more WebGL knowledge than me can fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants