Ok maybe I'm an idiot but wouldn't the simplest algorithm be<p>1) Choose highest building. Draw it's roof horizontal only.<p>2) Repeat 1) choosing building by next height lower, unless lower building roof within range of an existing rendered roof x+width, then exclude that building from rendering.<p>3) Once all buildings roofs drawn, draw the building side verticals downwards from each until they hit a roof or ground (either from a cache or detecting pixel colour), in which case stop.