mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-06-18 00:27:02 +08:00
feat: add biome boundary blending
This commit is contained in:
@@ -45,6 +45,7 @@ public:
|
|||||||
Chunk& chunk();
|
Chunk& chunk();
|
||||||
Random& random();
|
Random& random();
|
||||||
const std::array<BiomeType, 8>& neighbor_biome() const;
|
const std::array<BiomeType, 8>& neighbor_biome() const;
|
||||||
|
void generate_cave();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static inline std::atomic<bool> is_init{false};
|
static inline std::atomic<bool> is_init{false};
|
||||||
@@ -58,7 +59,6 @@ private:
|
|||||||
unsigned m_chunk_seed = 0;
|
unsigned m_chunk_seed = 0;
|
||||||
|
|
||||||
void make_biome_builder();
|
void make_biome_builder();
|
||||||
void generate_cave();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Cubed
|
} // namespace Cubed
|
||||||
@@ -292,7 +292,8 @@ void Chunk::gen_phase_six(
|
|||||||
Logger::error("ChunkGenerator is Nullptr");
|
Logger::error("ChunkGenerator is Nullptr");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// m_generator->blend_surface_blocks_borders(neighbor_block);
|
m_generator->blend_surface_blocks_borders(neighbor_block);
|
||||||
|
m_generator->generate_cave();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Chunk::gen_phase_seven() {
|
void Chunk::gen_phase_seven() {
|
||||||
|
|||||||
@@ -431,7 +431,6 @@ void ChunkGenerator::generate_terrain_blocks() {
|
|||||||
}
|
}
|
||||||
m_chunk.blocks().assign(CHUNK_SIZE * CHUNK_SIZE * WORLD_SIZE_Y, 0);
|
m_chunk.blocks().assign(CHUNK_SIZE * CHUNK_SIZE * WORLD_SIZE_Y, 0);
|
||||||
m_biome_builder->build_biome();
|
m_biome_builder->build_biome();
|
||||||
generate_cave();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChunkGenerator::blend_surface_blocks_borders(
|
void ChunkGenerator::blend_surface_blocks_borders(
|
||||||
|
|||||||
Reference in New Issue
Block a user