Which processes are necessary for the formation of metamorphic rocks?