More dynamic terrain generation (Still doing it wrong i think)

This commit is contained in:
Ben Kyd
2019-11-05 14:23:03 +00:00
parent 573ad69ee4
commit 84cece0825
3 changed files with 63 additions and 10 deletions

View File

@@ -17,12 +17,14 @@ void World::LoadWorld() {
m_shaders["Basic"]->Load(GameConfig.ResourceBase + "shaders/simple");
m_shaders["Basic"]->Link();
srand(time(NULL));
m_noiseGenerator = std::make_shared<FastNoise>();
m_noiseGenerator->SetSeed(rand());
m_noiseGenerator->SetNoiseType(FastNoise::SimplexFractal);
m_noiseGenerator->SetFractalOctaves(3);
m_noiseGenerator->SetFractalOctaves(5);
for (int x = -4; x < 10; x++)
for (int y = -4; y < 4; y++) {
@@ -31,7 +33,7 @@ void World::LoadWorld() {
}
//
// Spawn generator threads
for (int i = 0; i < 7; i++) {
m_generatorThreads.push_back(std::thread([&]() {