rayshader (version 0.5.1)

ambient_shade: Ambient Occlusion

Description

Calculates Ambient Occlusion Shadow Map

Usage

ambient_shade(heightmap, anglebreaks = seq(1, 46, 15), sunbreaks = 12,
  maxsearch = 20, multicore = FALSE, zscale = 1, cache_mask = NULL,
  shadow_cache = NULL, progbar = TRUE, ...)

Arguments

heightmap

A two-dimensional matrix, where each entry in the matrix is the elevation at that point. All points are assumed to be evenly spaced.

anglebreaks

The angle(s), in degrees, as measured from the horizon from which the light originates.

sunbreaks

Default 12. Number of rays to be sent out in a circle, evenly spaced, around the point being tested.

maxsearch

Default 20. The maximum distance that the system should propogate rays to check for .

multicore

Default FALSE. If TRUE, multiple cores will be used to compute the shadow matrix. By default, this uses all cores available, unless the user has set `options("cores")` in which the multicore option will only use that many cores.

zscale

Default 1. The ratio between the x and y spacing (which are assumed to be equal) and the z axis.

cache_mask

Default `NULL`. A matrix of 1 and 0s, indicating which points on which the raytracer will operate.

shadow_cache

Default `NULL`. The shadow matrix to be updated at the points defined by the argument `cache_mask`.

progbar

Default `TRUE`. If `FALSE`, turns off progress bar.

...

Additional arguments to pass to the `makeCluster` function when `multicore=TRUE`.

Value

Shaded texture map.

Examples

Run this code
# NOT RUN {
#Here we produce a ambient occlusion map of the `volcano` elevation map.
amb = ambient_shade(heightmap = volcano, 
   sunbreaks = 15, 
   maxsearch = 100)
   
plot_map(amb)
# }

Run the code above in your browser using DataLab