mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
add 'heights-interpolation', 'biomes-interpolation'
This commit is contained in:
parent
99d9533453
commit
d8c3940451
5 changed files with 33 additions and 3 deletions
|
|
@ -209,6 +209,12 @@ struct GeneratorDef {
|
|||
/// @brief Heightmap blocks per dot
|
||||
uint heightsBPD = 4;
|
||||
|
||||
/// @brief Biome parameter maps interpolation method
|
||||
InterpolationType biomesInterpolation = InterpolationType::LINEAR;
|
||||
|
||||
/// @brief Height maps interpolation method
|
||||
InterpolationType heightsInterpolation = InterpolationType::LINEAR;
|
||||
|
||||
/// @brief Number of chunks must be generated before and after wide
|
||||
/// structures placement triggered
|
||||
uint wideStructsChunksRadius = 3;
|
||||
|
|
|
|||
|
|
@ -307,13 +307,13 @@ void WorldGenerator::generateBiomes(
|
|||
copy->resize(
|
||||
floordiv(CHUNK_W, def.heightsBPD) + 1,
|
||||
floordiv(CHUNK_D, def.heightsBPD) + 1,
|
||||
InterpolationType::LINEAR
|
||||
def.heightsInterpolation
|
||||
);
|
||||
prototype.heightmapInputs.push_back(std::move(copy));
|
||||
}
|
||||
for (const auto& map : biomeParams) {
|
||||
map->resize(
|
||||
CHUNK_W + bpd, CHUNK_D + bpd, InterpolationType::LINEAR
|
||||
CHUNK_W + bpd, CHUNK_D + bpd, def.biomesInterpolation
|
||||
);
|
||||
map->crop(0, 0, CHUNK_W, CHUNK_D);
|
||||
}
|
||||
|
|
@ -345,7 +345,7 @@ void WorldGenerator::generateHeightmap(
|
|||
);
|
||||
prototype.heightmap->clamp();
|
||||
prototype.heightmap->resize(
|
||||
CHUNK_W + bpd, CHUNK_D + bpd, InterpolationType::LINEAR
|
||||
CHUNK_W + bpd, CHUNK_D + bpd, def.heightsInterpolation
|
||||
);
|
||||
prototype.heightmap->crop(0, 0, CHUNK_W, CHUNK_D);
|
||||
prototype.level = ChunkPrototypeLevel::HEIGHTMAP;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue