DigitalLibrarian / VS2010Projects

Bunch of unorganized mess
1 stars 1 forks source link

Virtual Chunk Memory / Paging #8

Open DigitalLibrarian opened 8 years ago

DigitalLibrarian commented 8 years ago

Currently the system just creates a new chunk whenever something asks about a position in the chunkspace.
This is not ideal.

It should keep a relatively small set of chunks in memory at any given time. When the player moves, it should dispose of some chunks that were moved away from, and generate page faults for chunks that were moved to. These disposal and page fault events/requests will be extension points for other systems, like the file save system, and terrain generation, or maybe even a network connection.

DigitalLibrarian commented 8 years ago

Chunk is going to need to be able to emit events that represent needing to have its instance buffer rebuilt, rather that merely rebuilding it right away next frame. Then this behavior has be centered around a ThrottleQueue so giant explosions and massive lasers don't kill fps.

DigitalLibrarian commented 8 years ago

Effect should be loaded and shared external to the Chunk class. No use keeping thousands of copies of the shader handle around, loading and unloading it.

DigitalLibrarian commented 8 years ago

The current thinking is to maintain an oct tree that is "centered" at the player. As the player moves through the world, the oct tree is extended in any direction by adding new parents and children.

I am imagining this as the basis for a LOD system. The depth and subdivisions of the tree will be bigger, the closer the location is to the player. Far away, where LOD is low, the depth of the tree will be low.

As the player moves from high LOD to low LOD, the tree will need to be rebalanced so that the highest LOD region is centered around the player.

DigitalLibrarian commented 8 years ago

It is very likely that we will end up with two paging systems. One copy on the cpu and one copy on the gpu. If the gpu encounters missing data, it page faults to the cpu to load it. If the cpu doesn't have the data, then it page faults out to an abstracted sampling source to fill in missing data.