Way before "The Matrix". Humans had trashed the planet so much there was a planetwide effort (successful) to remove everyone's brains and store them in vats (or whatever they called them in the story). The brains were conscious. The brains were watched over by computers, who (if I remember correctly) were benevolent, or at least appeared to be. The brains were supposed to remember their dreams and describe them to the watchers. When a brain became good enough, they were moved up a level in the big brain-holding structure, eventually reaching the top floor where they were supposedly transferred into perfect human bodies created for just such a purpose. The newly rebodied people were then supposedly allowed out onto earth, which had been restored to an Eden-like state. The story is told from the perspective of one of the brains, who (through some kind of bureaucratic mixup), had been one of the people who conceived the whole plan, but he'd gotten lost in the shuffle. The story ends with the brain having a dream in which he is immobilized on a gurney, gradually pared back to where he is just a brain, without anesthetic (I think), and then he sees himself from above, as just a brain, being served as a delicacy to some rich diner. The end of the story really sticks with you. The story might be a novel, or novella. I thought it had run in Playboy magazine, but I've been going through the tables of contents of their anthologies on Amazon and don't recognize it, so maybe not.