improve acoustics

This commit is contained in:
MihailRis 2026-02-10 23:48:24 +03:00
parent 9f9c7074f7
commit b355e4568d

View file

@ -115,7 +115,10 @@ void Decorator::updateAcoustics(const Camera& camera) {
hit++;
averageDistance += distance * 0.2f;
}
float decayTime = (averageDistance / hit) * glm::max(0.0f, glm::pow(hit / static_cast<float>(rays), 9.0f) - 0.6f) * 1.6f;
float decayTime =
glm::sqrt(averageDistance / hit) *
glm::max(0.0f, glm::pow(hit / static_cast<float>(rays), 3.0f) - 0.6f) *
1.6f;
decayTime *= 2.5f;
decayTime *= decayTime;
logger.info() << "rays hit " << hit << "/" << rays << " decay-time: " << decayTime;