feat: noise modifier will only add height

Or remove height with a negative amplitude
This commit is contained in:
Sara Gerretsen 2026-04-22 22:22:59 +02:00
parent 20de012dca
commit 3f233a176f

View file

@ -24,7 +24,7 @@ float TerrainModifierNoise::evaluate_at(Vector2 world_coordinates, float before)
if (this->noise.is_null()) {
return before;
}
return this->noise_amplitude * (this->noise_buffer->get_noise_2d(world_coordinates.x, world_coordinates.y) * 0.5f + 0.5f) + before;
return 0.5f * this->noise_amplitude * (this->noise_buffer->get_noise_2d(world_coordinates.x, world_coordinates.y) + 1.f) + before;
}
void TerrainModifierNoise::set_noise(Ref<Noise> noise) {