Z Shadowinfo [best] < Ultimate >
The input is a Digital Surface Model (DSM). For a given sun azimuth ($\phi$) and elevation ($\theta$), we perform a parallel projection to generate a binary shadow raster. Unlike standard methods, we tag each shadow pixel with the "height of origin" ($Z_origin$) of the object casting the shadow. This results in a "Z-Weighted Shadow Map."
/* REXX – SHADOWINFO */ parse arg dsname say "Catalog search for:" dsname "LISTCAT ENTRIES('"dsname"') ALL" z shadowinfo