Show HN: A raytracer to shade topographic maps in R, Part 2
tylermw.com
tylermw.com
https://news.ycombinator.com/item?id=17065264
The feedback in that thread was great, and I ended up implementing several of the suggestions given in the comments. Thanks for all the help!
I’ve never found photos online that half show how awesome the map gallery is. If I ever get back to the Vatican, I plan on spending 90 of my time there.
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.138...
This shows relaxed cone mapping, which is a very elegant and effective optimization.
The maps in the Vatican museum are indeed very cool, in fact the Vatican in general blew me away, and I've seen a fair number of impressive historical sites in Europe/Near East.
GRASS does have a raytracing option, but if you look up the images produced by it--they aren't pretty. Much more of a functional API to see where actual shadows are falling, and not at all something to produce nice looking maps.
The real killer feature in rayshader is the seamless API for combining all of these layers. Being able to adjust the intensity of each layer individual, add water, change color and texture programmatically--no other software focuses nearly as much on the aesthetics of a great looking map.
I haven't found anything other than actual 3D modeling software that can produce similar-style hillshades--combining texturing, raytracing, local shadows, and ambient occlusion. What's great (in my highly biased opinion!) about this package is the ability to go programmatically straight from the DEM to a hillshade, without having to save the data and load it into Blender or something similar.
https://i.imgur.com/GBTjJUm.jpg
Notice the correct soft self reflections on the sides of the hills in the shade.
Also, I like that quote: > Ask the internet how to do something and you’re likely to get a bunch of digital shrugs and maybe—if you’re lucky—a passive aggressive link to a Wikipedia page. Tell the internet you’ve done something—and they’ll tell you exactly what you can do to improve it.
Everything here is produced and adjustable programmatically: need to change the highlight color in the texture? Just use the create_texture function with the colors. Want to tone down raytraced shadows? Decrease the max_darken value in add_shadow. Rotate the sun direction or the color of the water? It's all straightforward. This library is designed to be as seamless and flexible as possible, so you never have to leave R to produce a nice looking map.