I have a sound in a 3D game that I want to simply fade in as you approach the source, but not pan at all.
I thought that setting pan level on the event to 0 would do this – but it seems to get rid of the volume falloff as well. So the sound just instantly plays at full volume as soon as you enter the max distance.
Is this how the 3D pan is meant to work? And if so how do I get the ‘2D’ positional sound (with a 3D volume falloff) that I’m after?
- Todd_B asked 10 years ago
I think the easiest way would be to set your event 3d rolloff to ‘custom’ then just add a ‘distance’ parameter to the event, then add a volume curve that attenuates the volume based on distance.
Then you get no panning, just a volume rolloff.
1 = Sound pans and attenuates according to 3d position. 0 = Attenuation is ignored and pan/speaker levels are defined by Channel::setPan, Channel::setSpeakerMix, Channel::setSpeakerLevels. Default = 1 (all by 3D position). [/quote:2xx7o40b]
You are correct changing the pan level to 0 is equivalent to making it a 2d sound. So in addition to losing the panning you also lose the distance based attenuation/occlusion effects.
I can think of two work arounds:
1. Manually calculating the attenuation and using setVolume.
- If you wanted to use FMOD’s 3D engine to do those calculations and to take into account geometry as well you could instead define an event/sound object with a silent sound def and use the getAudibility/setVolume and get3DOcclusion/set3DOcclusion functions to replicate the behaviour in your own sounds.
Hope this helps.
- Guest answered 10 years ago
Please login first to submit.