Dewetting mechanisms and their exploitation for the large-scale fabrication of advanced nanophotonic systems