0
0

Hi!

This should be an easy one!!

I’m working with an Opengl 3d engine!

and i m getting hard time setting up FSOUND_3D_SetMinMaxDistance(0,1)!

my question is:

1 gl unit = ? fmod unit(s)

if we have:

FSOUND_3D_SetMinMaxDistance(1,1)…
the 3d sound at 0,0,0
the listner at 0, 0, 1.1

my guess is… i’m not gonna hear anything…

and if the listner position is at 0, 0, 0.99

i ll be hearing the sound full blast!

right?

Thx

Golgoth

  • You must to post comments
0
0

you can change your unit factor with void FSOUND_3D_SetDistanceFactor();

FSOUND_3D_SetMinMaxDistance() doesn’t set some kind of unit factor.
you can consider it like some sort of near/far planes.
but this does not clip the sound, it clips the attenuation/amplification of the sound.
the sound won’t be attenuated anymore after the Max distance, and won’t be anymore amplified anymore if the sound source is nearest than the Min distance.

fo exemple, in OpenGl/D3D code, if you have a near/far clip couple of 0.5/1000. (0.5meters to 1000meters), you could set MinMaxDistance to something like 0.3/800…..

in if your Opengl World, 1 means 10meters, i think you have to call FSOUND_3D_SetDistanceFactor( 10 ) to let FMOD do the right attenuation/distance calculus.

  • You must to post comments
0
0

[color=orange:1pn5iumi]the sound won’t be attenuated anymore after the Max distance!!![/color:1pn5iumi]

but how come I still hear the sound when I m out the max distance range?
Even if I’m really far away from it… I’m still hearing it… the volume is really low but it’s still playing!

then again… the max distance should be at wich point you dont hear anything right? if listner distance > sound position + sound max range then sound volume = 0, sound stop, mute, pause or whatever…! but i dont want a hear it…

[color=orange:1pn5iumi]in if your Opengl World, 1 means 10meters[/color:1pn5iumi]

Well thats a tricky one… the opengl units are abitrary… 1 unit could be anything… even if I say out loud… hey! units… you guys are meters… there still gonna be unreferenced. I hope I’m wrong…

So far I tried to set FSOUND_3D_SetDistanceFactor() from 0,000000001 to 100000000 and still doesnt do squad… the attenuation is always the same!

bool Fmod::Init()
{
FSOUND_Init(44100, 32, FSOUND_INIT_GLOBALFOCUS);
FSOUND_3D_SetDistanceFactor(10);
FSOUND_3D_SetRolloffFactor(1);

return true;

}

it does attenuate thought but on what basis?… well this is still unknowned yet… did I’ve mention I’m on Windows 2000!? Any knowned issues or something I should be awared of?

Golgoth

  • You must to post comments
0
0

look at the documentation…

the max distance is not the mute distance, it’s the distance when the attenuation will become constant. it’s used to simulate loud and distant sound (ie like the docs says, something like a boeing reactor, a train far distant, or a sniper shoot).

you must implement the sound (channel) stop by yourself :/

concerning the unit meaning in OpenGl, it’s up to you to know what you are doing. nobody will know it for you :(
you have to setup a unit standard in your engine, so that 3d meshes and other world dataset comply to this standard….

  • You must to post comments
0
0

Hummm!

What will be the formula to:
how far the listener needs to be from the sound before it fades out completly? or if you prefer… at what distance the player needs to be from a sound before hearing it?

fmod is probably based on real life equations… but

what about giving the user the possibility to set the ATTENUATION_FADE_SOUND_VOLUME_TO_ZERO_DISTANCE ?

cauze the attenuation distance is quite an important behaviour… and users will definitly appreciate more control over it… for exemple… we need to fade out manualy each playing or looping sound before stopping it!!!! and this… takes extra process we can use some place else… when u go from room to room… sounds do not travel througth walls as easy as they do in the outside world… so even if u like when it sounds real… you cant always do it virtualy… cause many peices of the puzzle are still missing… we may see real-time sound bouncing in a near future… but till then… we need more power over our sound assets!

Feels like i m taking crazy pills! 😉

Golgoth

  • You must to post comments
0
0

you can do all that yourself :)
[code:30z6wkgv]
FSOUND_3D_SetRolloffFactor(0f);
[/code:30z6wkgv]
so the sounds volume necer gets effected. next set the volume on each sample/stream.
All the 3d panning Jazz will still work as it should.
[code:30z6wkgv]
FSound.FSOUND_SetVolume(soundchannel, (int)vol);
[/code:30z6wkgv]
bingo :) have any crazy max min u like.

heres the code if u want to pop yer feet up; im doing all this in Java so
here u go- works fine for me so far:
[code:30z6wkgv]
public float minmax(float currentdistance, float mindistance, float maxdistance, float scale) {
float clipdistance = (float)Math.max(Math.min(currentdistance, maxdistance), mindistance);
float range = maxdistance – mindistance;
float relativedistance = clipdistance – mindistance;
float normaldistance = relativedistance /range;
float volume = (1 – normaldistance) * scale;
return(volume);
}
[/code:30z6wkgv]

hope that helps

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.