From 9f9c7074f7ed9cd09b5bd79e0d767f15b2529378 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 6 Jan 2026 15:39:53 +0300 Subject: [PATCH] fix --- src/audio/AL/ALAudio.cpp | 2 +- src/graphics/render/Decorator.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/audio/AL/ALAudio.cpp b/src/audio/AL/ALAudio.cpp index 555336e93..66b5b8c8c 100644 --- a/src/audio/AL/ALAudio.cpp +++ b/src/audio/AL/ALAudio.cpp @@ -792,6 +792,6 @@ void ALAudio::setAcoustics(Acoustics acoustics) { AL_CHECK(alEffectf(reverbEffect, AL_REVERB_ROOM_ROLLOFF_FACTOR, 0.14f)); // AL_CHECK(alEffectf(reverbEffect, AL_REVERB_GAIN, 0.0f)); // AL_CHECK(alEffectf(reverbEffect, AL_REVERB_GAINHF, 0.0f)); - AL_CHECK(alEffectf(reverbEffect, AL_REVERB_REFLECTIONS_GAIN, 0.5f)); + AL_CHECK(alEffectf(reverbEffect, AL_REVERB_REFLECTIONS_GAIN, 0.99f)); alAuxiliaryEffectSloti(effectSlots[0], AL_EFFECTSLOT_EFFECT, reverbEffect); } diff --git a/src/graphics/render/Decorator.cpp b/src/graphics/render/Decorator.cpp index 77aaa5cda..85e86ba40 100644 --- a/src/graphics/render/Decorator.cpp +++ b/src/graphics/render/Decorator.cpp @@ -91,7 +91,7 @@ void Decorator::addParticles(const Block& def, const glm::ivec3& pos) { void Decorator::updateAcoustics(const Camera& camera) { audio::Acoustics acoustics {}; - util::PseudoRandom random(0x34621B361); + util::PseudoRandom random(34621U); auto& chunks = *player.chunks; const auto& start = camera.position; @@ -115,7 +115,7 @@ void Decorator::updateAcoustics(const Camera& camera) { hit++; averageDistance += distance * 0.2f; } - float decayTime = (averageDistance / hit) * ((hit / static_cast(rays)) - 0.6f) * 1.6f; + float decayTime = (averageDistance / hit) * glm::max(0.0f, glm::pow(hit / static_cast(rays), 9.0f) - 0.6f) * 1.6f; decayTime *= 2.5f; decayTime *= decayTime; logger.info() << "rays hit " << hit << "/" << rays << " decay-time: " << decayTime;