Ancient humans probably knew this too because many examples of carvings and paintings were made in places protected from the elements, like caves and overhangs. They probably also decorated more exposed areas that haven't survived as well, as you note.
Mesa Verde as one example includes such cultural works dating back to 600CE. https://www.nps.gov/meve/index.htm