mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 04:21:50 +00:00
clamp effect parameters values
This commit is contained in:
parent
92eeee5a20
commit
a43f41182d
2 changed files with 67 additions and 9 deletions
|
|
@ -141,8 +141,10 @@ void Decorator::updateAcoustics(const Camera& camera) {
|
|||
averageDistance += distance;
|
||||
averageAbsorption += material->soundAbsorption;
|
||||
}
|
||||
averageDistance /= hit;
|
||||
averageAbsorption /= hit;
|
||||
if (hit > 0) {
|
||||
averageDistance /= hit;
|
||||
averageAbsorption /= hit;
|
||||
}
|
||||
|
||||
float decayTime = 20.0f * (averageDistance / rayLength);
|
||||
float escapeRatio = static_cast<float>(rays - hit) / static_cast<float>(rays);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue