mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 06:51:51 +00:00
fix
This commit is contained in:
parent
72aba4d31d
commit
9f9c7074f7
2 changed files with 3 additions and 3 deletions
|
|
@ -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_ROOM_ROLLOFF_FACTOR, 0.14f));
|
||||||
// AL_CHECK(alEffectf(reverbEffect, AL_REVERB_GAIN, 0.0f));
|
// AL_CHECK(alEffectf(reverbEffect, AL_REVERB_GAIN, 0.0f));
|
||||||
// AL_CHECK(alEffectf(reverbEffect, AL_REVERB_GAINHF, 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);
|
alAuxiliaryEffectSloti(effectSlots[0], AL_EFFECTSLOT_EFFECT, reverbEffect);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ void Decorator::addParticles(const Block& def, const glm::ivec3& pos) {
|
||||||
|
|
||||||
void Decorator::updateAcoustics(const Camera& camera) {
|
void Decorator::updateAcoustics(const Camera& camera) {
|
||||||
audio::Acoustics acoustics {};
|
audio::Acoustics acoustics {};
|
||||||
util::PseudoRandom random(0x34621B361);
|
util::PseudoRandom random(34621U);
|
||||||
|
|
||||||
auto& chunks = *player.chunks;
|
auto& chunks = *player.chunks;
|
||||||
const auto& start = camera.position;
|
const auto& start = camera.position;
|
||||||
|
|
@ -115,7 +115,7 @@ void Decorator::updateAcoustics(const Camera& camera) {
|
||||||
hit++;
|
hit++;
|
||||||
averageDistance += distance * 0.2f;
|
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 *= 2.5f;
|
||||||
decayTime *= decayTime;
|
decayTime *= decayTime;
|
||||||
logger.info() << "rays hit " << hit << "/" << rays << " decay-time: " << decayTime;
|
logger.info() << "rays hit " << hit << "/" << rays << " decay-time: " << decayTime;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue