I’ve noticed something very distracting with panning:
We set the listener position to be the player. When the player moves past an object, the sound pans from left to right as the player passes the object. This is fine.
For most environment objects, this isn’t too much of a problem since the sound position and the player’s position are "far enough apart". (eg: a fireplace: the player cannot walk into it, so there’s a restriction in the game that means the player is always at least 1m away from the sound source position).
However, I’m making some sounds of doors and interactive objects where the player can essentially be "inside" the object.
This situation results in sounds that pan incredibly fast: ie: from 100% left speaker to 100% right speaker very quickly for only a small movement on the screen. It’s way too much.
I’d love a "near field" effect where the sound would be considered "centre" on the player when within a certain radius (like 3d min distance) so that sound sources below this distance blend towards centre.
Perhaps something like this psuedo-code:
sound_position = 3d position of sound (sound position – listener position)
min_distance = 3d minimum distance
distance = length of sound_position vector above
normal_pan = normal pan position
centre_pan = centre pan position
if distance < min_distance
near_field_effect = distance / min_distance
pan = (1 – near_field_effect) * centre_pan + near_field_effect * normal_pan
do normal panning
In this way, when the sound source gets closer than the 3d min distance, it would progressively blend to mono when at the same position and not have any snappy left/right changes for minute position changes.
This is also a bit similar to ramping the 3d pan level to 0 when the distance < 3d_min_distance.
But I don’t want to rely on the 3d pan level, because it’s not available on all platforms.
- mattconnolly asked 9 years ago
This sounds like exactly what we need as well. We are experiencing similar "excessive" panning issues, though ours are more to do with the listener moving at a high rate of speed. FMOD support suggested we fix this in our game code, however was pretty sure we aren’t the only ones experiencing issues like this (as this thread proves). I feel that an API level solution would probably more efficient though, and we are so close to ship it isn’t really possible to change our engine code at this time.
- therock answered 9 years ago
[quote:36jgakn0]I don’t want to rely on the 3d pan level, because it’s not available on all platforms.[/quote:36jgakn0]
3D panlevel is now available on all platforms.
[quote:36jgakn0]we are so close to ship it isn’t really possible to change our engine code at this time.[/quote:36jgakn0]
Any new features would go into development branch, we recommend users only ship with the stable branches so I don’t think you could use an API level solution either.
Since this is only an issue with non-standard usage of the API, we provide the 3d pan level feature to allow developers to override the standard panning behaviour for these special cases.
- Guest answered 9 years ago
Please login first to submit.