I'm working on a project where audio propagates through a series of rooms and portals. This is modeled by finding all paths from a source to listener and then merging their contributions into a final audio stream. The issue is for the math to make sense the paths have to be both consistent and realistic:
- Consistent in the sense that paths should only come into existence at the edge of the maximum sound distance, to make sure there is no audio pop-in.
- Realistic in that if a path traverses more space than necessary, it creates discontinuities. For example if the paths went through the center of the portals, larger portals would create unnecessarily larger paths.
To solve this I came up with a heuristic that tries to pick smart crossing points and it comes up with pretty tight paths, but not for all cases.
The question:
It seems to me I can solve this with a string-pulling algorithm, but most of what I've seen either uses LOS checks (which I rather not do) or are only talked about in a 2D context. Given that I already have portals that describe the degrees of freedom of each crossing, I was wondering if there is an algorithm that matches my constraints.