tylermorganwall / rayshader

R Package for 2D and 3D mapping and data visualization
https://www.rayshader.com/
2.06k stars 213 forks source link

Rayshader not rendering #49

Closed kieroneil closed 4 years ago

kieroneil commented 5 years ago

I was going through the sample code in the blog and ggplots render fine but when I run plot_gg this example takes about 2 minutes to show an RGL device box with a couple of intersecting lines on a white background, that's all. The warning messages are at the bottom. Hopefully it's just user error but let me know if I need to change something.
` remotes::install_github("tylermorganwall/rayshader")

library(ggplot2) library(readr) library(viridis) library(rayshader)

=======================================

Example 1

gg <- ggplot(diamonds, aes(x, depth)) + stat_density_2d(aes(fill = stat(nlevel)), geom = "polygon", n = 100,bins = 10,contour = TRUE) + facet_wrap(clarity~.) + scale_fill_viridis_c(option = "A")

plot_gg(gg,multicore=TRUE,width=5,height=5,scale=250)

sessionInfo() R version 3.5.1 (2018-07-02) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows Server >= 2012 x64 (build 9200)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] rayshader_0.11.0 viridis_0.5.1 viridisLite_0.3.0 readr_1.3.1 ggplot2_3.2.0
Warnings: Warning messages: 1: In rgl.surface(1:nrow(heightmap), -(1:ncol(heightmap)), heightmap[, : RGL: GL Library : Maximum texture size of 1024x1024 exceeded. (Perhaps enabling mipmapping could help.) 2: In rgl.primitive("triangles", x, y, z, normals, texcoords, ...) : RGL: GL Library : Maximum texture size of 1024x1024 exceeded. (Perhaps enabling mipmapping could help.) 3: In rgl.primitive("lines", x, y, z, ...) : RGL: GL Library : Maximum texture size of 1024x1024 exceeded. (Perhaps enabling mipmapping could help.) 4: In rgl.surface((-shadowwidth + 1):(rows + shadowwidth), -(-shadowwidth + : RGL: GL Library : Maximum texture size of 1024x1024 exceeded. (Perhaps enabling mipmapping could help.)`

tylermorganwall commented 5 years ago

What version of rgl are you running?

kieroneil commented 5 years ago

When I submitted the issue it was rgl_0.100.19. I installed the latest version, 0.100.24, and I'm getting different messages now and the same output. See image.

Rayshader Issue 49
tylermorganwall commented 5 years ago

Try looking at this closed issue and see if any of the solutions there fix your problem:

https://github.com/tylermorganwall/rayshader/issues/26

kieroneil commented 5 years ago

It is possible that it's a zlib issue. I'm a little worried about installing something that is over 12 years old on my work laptop though.
When I get home I'm going to try runnng the exact same code on my Mac and see if that works.
If so then at least we know it's a windows issue.

tylermorganwall commented 5 years ago

If you can compile rgl from source (remotes::install_github("rforge/rgl")), see if you see this error:

checking for zlib...no libpng requires zlib, so not installed. freetype requires zlib, so not installed.

If so, then that is definitely the issue.

chasemc commented 5 years ago

I was having the same issue reinstalling rgl using install.packages fixed the problem for me. (Note: may or may not matter, but I installed from binary not from source)

leungi commented 5 years ago

@tylermorganwall: I installed zlib as per your suggestion in #26 , but R doesn't see it on rgl install still (i.e., checking for zlib...no).

I changed the ~/R-3.5.1/etc/x64/Makeconf file to set ZLIB_LIBS = "C:/Program Files (x86)/GnuWin32/lib", but still no luck.

Any advice?

Thanks in advance.

soleildeminuit commented 5 years ago

For me, installing rgl from source results in this issue. Re-installing rgl from binary solves it.

leungi commented 5 years ago

@anderselias: thanks for comment.

Tried these and still fail to have rayshader (or more like rgl) working completely:

  1. uninstall both rgl and rayshader
  2. tried both 0.100.24 (CRAN) and 0.100.25 (r-forge.r-project.org) - source and binaries
  3. install rayshader with remotes::install_github("tylermorganwall/rayshader")
  4. uninstall both rgl and rayshader again
  5. install rgl via dependencies requirement with remotes::install_github("tylermorganwall/rayshader")
  6. rgl fails to install, so had to go back to steps 2) and 3) to reinstall rgl and rayshader

All the above gives the same issue as @kieroneil; renders fine, but definitely missing stuff 😞.

Error message on render:

3: In rgl.material(...) : RGL: Pixmap load: file format unsupported
4: In rgl.material(...) : RGL: Pixmap load: failed
5: In rgl.material(...) : RGL: Pixmap load: file format unsupported
6: In rgl.material(...) : RGL: Pixmap load: failed

I got conflicting info via forums about the need for zlib. I do have zlib installed as per previous post, but rgl install still doesn't recognize it; any ideas @tylermorganwall? 🙏

tylermorganwall commented 4 years ago

@leungi still having this issue?

leungi commented 4 years ago

@tylermorganwall: it's been resolved with these package versions:

> packageVersion("rayshader")
[1] ‘0.13.1’
> packageVersion("rgl")
[1] ‘0.100.30’