Ab initio optical study of graphene on hexagonal boron nitride and fluorographene substrates