Occlusion
Description
Creates a pixel layer that renders ambient occlusion terms as grayscale pixels into the output pixel buffer (black := fully occluded, white := no occlusion).
Ambient occlusion is computed by casting 16 rays (see 0
.. F
) per pixel (see x
), collecting the horizon angle for each one. The resulting ambient occlusion term is the average horizon angle (i.e. 0
means no occlusion at 0°, 1
means maximum occlusion at 90°).
+---+---+---+---+---+ | A | B | C | D | E | +---+---+---+---+---+ | 9 | | | | F | | +---+---+---+---+---+ | | 8 | | x | | 0 | ---+--> X +---+---+---+---+---+ | | 7 | | | | 1 | V +---+---+---+---+---+ Y | 6 | 5 | 4 | 3 | 2 | +---+---+---+---+---+
The range parameter can be used to speed up computation time, at the cost of accuracy. In combination with the padding parameter, the generated pyramid tiles will be seamless iff range is not zero and less than or equal to padding.