Cannot generate clouds in Rayshader due to DEM issues?

101 Views Asked by At

I'm very new to the R package, rayshader, and have successfully run the entire example script (from the rayshader.com website) using the default DEM.

However, I am having trouble with using my own DEM. The only error I am running into in my script is when I am trying to add clouds into my plot_3d. This is where the error originates:

elmat %>% 
sphere_shade(texture = "desert") %>%
  add_water(detect_water(elmat), color = "lightblue") %>%
  add_shadow(cloud_shade(elmat, zscale = 10, start_altitude = 672, end_altitude = 1593,), 0) %>%
  plot_3d(elmat, zscale = 10, fov = 0, theta = 135, zoom = 0.75, phi = 45, windowsize = c(1000, 800),
          background="darkred")

render_camera(theta = 20, phi=40,zoom= 0.64, fov= 56 )
render_clouds(elmat, zscale = 10, start_altitude = 1000, end_altitude = 1593, attenuation_coef = 2, clear_clouds = T)
render_snapshot(clear=FALSE)

However, after the "render_clouds" line is executed, I get this error:

Error in render_floating_overlay(generate_cloud_layer(heightmap, coef = attenuation_coef,  : 
  If `remove_na = TRUE`, `heightmap` and `overlay` must have same number of rows and columns to make overlay transparent at those points

I'm assuming this stems from a problem with my personal DEM I am using. Any idea on what is going on here? Any help would be greatly appreciated!

0

There are 0 best solutions below