Learn R Programming

spanner (version 1.0.2)

compute_ssao: Compute SSAO (Screen Space Ambient Occlusion) for point cloud

Description

Fast ambient occlusion using 2D depth buffer technique. Much faster than PCV as it works on projected depth maps.

Usage

compute_ssao(
  las,
  kernel_size = 5,
  pixel_size = 0.1,
  num_samples = 16,
  ncpu = 4
)

Value

Numeric vector of SSAO values (ambient occlusion) for each point

Arguments

las

LAS object

kernel_size

Integer kernel size in pixels for sampling

pixel_size

Numeric resolution of the depth map in spatial units

num_samples

Integer number of samples per point

ncpu

Integer number of CPUs to use for parallel processing

Details

The SSAO algorithm computes ambient occlusion by:

  • Projecting the point cloud to a 2D depth map (grid)

  • For each point, sampling the depth buffer around it

  • Calculating occlusion based on depth differences

  • Applying distance and angle-based falloff

This is significantly faster than full 3D PCV because it only requires 2D image processing operations rather than 3D neighbor searches and ray tracing.