#Create a bathymetric hillshade
if(rayshader:::run_documentation()) {
water_palette = colorRampPalette(c("darkblue", "dodgerblue", "lightblue"))(200)
bathy_hs = height_shade(montereybay, texture = water_palette)
plot_map(bathy_hs)
}
if(rayshader:::run_documentation()) {
#Set everything below 0m to water palette
montereybay %>%
sphere_shade(zscale=10) %>%
add_overlay(generate_altitude_overlay(bathy_hs, montereybay, 0, 0)) %>%
add_shadow(ray_shade(montereybay,zscale=50),0.3) %>%
plot_map()
}
#Add snow peaks by setting `lower = FALSE`
snow_palette = "white"
snow_hs = height_shade(montereybay, texture = snow_palette)
if(rayshader:::run_documentation()) {
#Set the snow transition region from 500m to 1200m
montereybay %>%
sphere_shade(zscale=10, texture = "desert") %>%
add_overlay(generate_altitude_overlay(bathy_hs, montereybay, 0, 0)) %>%
add_overlay(generate_altitude_overlay(snow_hs, montereybay, 500, 1200, lower=FALSE)) %>%
add_shadow(ambient_shade(montereybay,zscale=50,maxsearch=100),0) %>%
plot_map()
}
Run the code above in your browser using DataLab