Developer of rayshader here: If you're interested in some of the thought process and details that went into creating and developing the package, I have a series of blog posts detailing them here (in order of appearance):
Fwiw, you can optimize your height map / grid traversal [1] quite a bit. There don’t need to be any ceil/floor calls within the inner loop if you do a “3D DDA” iteration (like Bresenham’s for lines but in 3D).
We used to have good slides on this from Steve Parker’s CS 6620 at Utah, but modern versions of the class seem to use OptiX instead. Some folks put their code up online, so if you search for CS 6620 and height map or terrain you might find it. Useful for volume rendering too!
Great idea! The mesh it iterates over is inherently 2D (the surface intersection test just performs a bilinear interpolation between the grid points to compare to the ray height) so Bresenham's algorithm would work here. I'll implement it and see if it offers any significant speed improvements.
These beautiful 3D shaded relief maps have been going past in my social feeds recently - https://scottreinhard.com/Mapping-and-Visualization - seems like your tool could be used to make something similar without requiring familiarity with 3D modelling packages (Blender I think).
Yep, I've seen those, and I've been tempted to throw together an example with rayshader to show how easy it is to do with just a few lines of code.
One of the main motivations behind developing rayshader was to democratize mapping--forcing people to become proficient in not one but two highly specialized software suites (any GIS software + blender) really made beautiful mapping unattainable for most. Plus, I just dislike GUIs in general, and wanted a code-based solution for map making :)
Amazingly beautiful work. Thanks for sharing your knowledge and process!
It would be cool to combine this with some kind of classifier for surface types and simulate water, glass, reflections, sub-surface scattering (basically other types of materials).
Have you played with any of the new hardware raytracing API’s from Nvidia RTX stuff?
I have not, but I'm including gltf 2.0 support in an upcoming version, so it should be possible to start exporting visualizations created with rayshader to more traditional 3D graphics workflows where you could take advantage of those features.
A second or two for everything you see here--the raytracing and color mapping bakes the texture into the surface, so after that the user can manipulate the 3D model to how they see fit. On larger datasets (10,000 x 10,000) it takes about a minute or so with default settings, but the user can cache the texture so they only have to calculate it once.
Thanks! Halfway down the page on this [1] post I share an image made with lidar data of downtown Austin. Lidar data is fairly noisy (this required a bit of pre-processing to remove artifacts) but you can indeed capture an urban environment fairly well.
The maps are generated directly from elevation data--all you need is an array of elevation values and the full maps are generated from those. A good source of elevation data for the USA is the National Map [1], but a much more comprehensive source is the SRTM Space Shuttle data [2] (it covers almost the entire earth at a 30m resolution).
http://tylermw.com/throwing-shade/ HN comments: https://news.ycombinator.com/item?id=17065264
http://www.tylermw.com/making-beautiful-maps/ HN comments: https://news.ycombinator.com/item?id=17424061
http://www.tylermw.com/3d-maps-with-rayshader/ HN comments: https://news.ycombinator.com/item?id=17697046
http://www.tylermw.com/3d-printing-rayshader/ HN comments: https://news.ycombinator.com/item?id=17851229
http://www.tylermw.com/portrait-mode-data/ HN comments: https://news.ycombinator.com/item?id=18282640