shade

fun shade(padded: ElevationTile, width: Int, height: Int, maxShadowAlpha: Float, metersPerSample: Float, margin: Int = MARGIN, shadeValleys: Boolean = false): FloatArray(source)

Shadow alpha per output pixel, 0f (no shading) to 1f (full shadow), row-major, width×height.

padded carries margin pixels of context on every side, and metersPerSample is its ground resolution (Hillshade.metersPerSample), which sets the slope. With shadeValleys, the margin must reach valleyMargin so each pixel can look out across the terrain around it, and ground that sees little sky darkens whichever way it faces the light.