I added an example to my tiny #Bevy #ProceduralGeneration library, #fernweh , demonstrating how one may use it to implement "layered" chunk-based procedural generation, that is, procedural generation where some data is shared across several chunks. This is typically useful for large-scale terrain features.
The example below works in a similar way as in the previous toot: chunks are represented by colorful polygons, chunks close to the player (the white disk) get spawned, chunks far away get despawned, and there is an artificial delay to simulate expensive computations.
The difference is now chunks are grouped in groups of four chunks which share data (namely, a color โ blue or red). The point is that data is only computed once, even though it is used by several chunks.
Fernweh is very flexible, so it is possible to use the same approach to group groups into even larger groups, or group chunks one way for one type of data, and another way for another type of data...
Keep in mind, though, that this relies on a yet unreleased Bevy feature, scenes (very likely to land in Bevy 0.19).
https://codeberg.org/glocq/fernweh/src/branch/next-gen-scenes
#rust