4 ms·
Once you generate a height (displacement) map and color map, any easy way to "shade" the color map? NASA has some pretty decent lunar displacement/color maps o
by JKCalhoun 5y ago
Once you generate a height (displacement) map and color map, any easy way to "shade" the color map?
NASA has some pretty decent lunar displacement/color maps of the moon but the color map is evenly lit (no shadows spilling into craters). To render this quickly I want to pre-render the shadows (maybe into the color-map itself).
- homarp 5y agoUse blender (might not be easy first time) https://somethingaboutmaps.wordpress.com/2017/11/16/creating-shaded-relief-in-blender/ https://somethingaboutmaps.wordpress.com/2017/11/16/creating... ?
- enriquto 5y agoThe easiest way is to compute the directional derivative with some direction pointing upwards. For example u_x + u_y, or convolving the height map with a 3x3 kernel with the following coefficients: 0 -1 0 -1 0 1 0 1 0 You may want to smooth the result if you see too much noise.
- wlesieutre 5y agoOr for the fancy version, you can raytrace the terrain shadows! https://news.ycombinator.com/item?id=17065264 https://news.ycombinator.com/item?id=17065264 The linked post has some good comparisons with derivative-based shading, it does sorta work but you can see it comes up short in conveying actual 3D shape compared to the raytraced version.
- tylermw 5y agoCheck out the rayshader R package for lots of methods for hillshading terrain maps (original HN post mentioned here as well, but it's evolved well beyond that original post) Website: https://www.rayshader.com https://www.rayshader.com