Recommended Reading on the Perceived Breadth of Content is Generated in Dreams?

(Not sure if this is the right sub for this question - I'd be interested in suggestions for related subs if not.) Earlier this evening, I woke up from a dream in which I was unlocking forgotten memories of whole fantasy worlds I had created as a child that were or could be made into books, games, series, and movies. I remembered characters, settings, story arcs, melody and lyrics from accompanying music, and much more (all evaporated upon waking, of course).

I can conceptualize in principle how the mind could create such a seemingly staggeringly broad array of content in a dream of just a few minutes. Imagine a computer game that appears to contain a vast library but only needs to procedurally generate a handful of lines of text corresponding to whatever page of whatever book the user happens to be looking at during any given moment. But I'd be interested in books or other media that go into how this aspect of dreaming works from a neuroscience and/or psychological perspective. Any suggestions?