Smooth directional off-axis attenuation curve

This commit is contained in:
Jage9
2026-02-22 21:45:40 -05:00
parent f3a7cc90a7
commit 9cfc995aa0
2 changed files with 3 additions and 2 deletions

View File

@@ -111,7 +111,8 @@ function resolveDirectionalProfile(
return { attenuationFactor: 1, offAxisRatio: 0 };
}
const span = Math.max(1, 180 - halfCone);
const offAxisRatio = Math.max(0, Math.min(1, (diff - halfCone) / span));
const linearRatio = Math.max(0, Math.min(1, (diff - halfCone) / span));
const offAxisRatio = linearRatio * linearRatio * (3 - 2 * linearRatio);
return {
attenuationFactor: 1 - offAxisRatio * (1 - rearGain),
offAxisRatio,