This commit is contained in:
MihailRis 2026-01-06 15:39:53 +03:00
parent 72aba4d31d
commit 9f9c7074f7
2 changed files with 3 additions and 3 deletions

View file

@ -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);
}

View file

@ -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<float>(rays)) - 0.6f) * 1.6f;
float decayTime = (averageDistance / hit) * glm::max(0.0f, glm::pow(hit / static_cast<float>(rays), 9.0f) - 0.6f) * 1.6f;
decayTime *= 2.5f;
decayTime *= decayTime;
logger.info() << "rays hit " << hit << "/" << rays << " decay-time: " << decayTime;