generalize shader replacement