Enable Biomemap Generation
Pre-release
Pre-release
Release 0.4.0-Preview.2
In this release our heightfield generator can generate biome map and store the map for each chunk. Later we will integrate heightmap generation with biomemap to create a multi-biome procedural world.
Highlights
- Break down chunk management engines into individuals, and remove automatica implicit constructions. For example previously instantiating
STPChunkProviderwill haveSTPHeightfieldGeneratorinstantiated automatically, nowSTPHeightfieldGeneratoris passed as a reference into the contructor call ofSTPChunkProvider. - All parameters passed to above said class are now by reference instead of copy, such that if one wishes to keep using low-level API call (constructing each component individually), all components and settings need to be kept alive until the engine is destroied.
- Add
STPWorldManageras a high-level API for easy initialisation of all generation engine components.
The purpose of doing this is to create some level of abstraction for each component, such that specific functions from each stage of the pipeline can be called directly from external environment. This will be particularly useful for setting up biome generator.
- Allow attaching a concrete instance of
STPBiomeFactorytoSTPWorldManager. - Allow heightfield generator linked with biome factory for biomemap generation.
- Enable non-blocking biomemap generation.
- Load biomemap into OpenGL buffer and enable biomemap to be visualised in fragment shader.
General improvement and fixes
- Add
constto some member functions of chunk engine components so they can be easily called by the returning reference fromSTPWorldManager. - Rename
sample_cached()inSTPLayertoretrieve()to avoid confusion and accidental call tosample()when writing concrete classes ofSTPLayer. - Rename
create()inSTPLayerManagertoinsert(). - Remove seed and salt argument in the
insert()above, allowing more abstract constructor of derivedSTPLayer