tylermorganwall / rayshader

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

Exporting high resolution images #28

Closed neilcharles closed 3 years ago

neilcharles commented 5 years ago

I think this is an rgl question really, but I'm interested in exporting hi-res images, larger than my screen.

Using rayshader::render_depth I get a screen-sized image and rgl.postscript (suggested here) just hangs because the scene is so large.

Any chance there's a better way to do it?

tylermorganwall commented 5 years ago

At this moment, rgl is limited to the size of the screen when taking snapshots. The workaround they talk about in the stackoverflow post (using a virtual frame buffer which acts as a separate user-defined monitor) is a good idea in theory, but rgl's implementation of snapshot3d is currently incompatible with xvfb and just produces black images. I attempted to integrate it myself starting at this commit (3e68b0d1aa96164a7fec8c7fb3c51ea26a2f33c8) but upon further research discovered this is still an active area of development in rgl and snapshots don't currently work.

See the rgl todo.txt for a mention of xvfb: https://github.com/rforge/rgl/blob/b89a3ec1e04429d20094642e3e13afb7fcc035fe/pkg/rgl/inst/todo.txt

If only rayshader had a built-in software renderer for non-interactive use... 🤔

neilcharles commented 5 years ago

Thanks. Sounds like I should wait a bit and keep an eye on your changes ;)

tylermorganwall commented 3 years ago

Arbitrary resolutions can now (as of commit 8e4353d55d1b5113b04482ace75f940f82335db9 ) be obtained via width/height arguments in render_snapshot() when software_render = TRUE.