0
0

I’ve had this tiny problem with geometry occlusion for a little while. It’s not a big issue but I am a little perplexed…

I set up cube occlusions in my game, for lopped channels it works great but for play once sounds I get a little bit of the sound when it starts when my listener is fully "occluded"… I probably get the same problem with looped sounds but they start far from the listenner’s position.

I tried calling FMOD Update right after I start the sound but I can’t seem to find the solution. I even tried starting the sound paused, then calling update then unpausing the sound…

I’m using linear sound fading for the 3d distance drop off and I’m running in software mode. I’m also using doppler effects.

Just poking to see if this is a known artefact of the geometry (when no set up right)

here is the code that sets up an occlusion block
[code:p1f8txmj]
export double FMODBlockerAdd(double x, double y, double z, double xs, double ys, double zs, double xe, double ye, double ze)
{
if(!inited) {{FMODASSERT(FMOD_ERR_INITIALIZATION);}}
if(geometry == NULL) {{FMODASSERT(FMOD_ERR_INITIALIZATION);}}
FMOD_GEOMETRY *g = NULL;
if(curgeometry >= maxgeometry) {FMODASSERT(FMOD_ERR_MEMORY);}
FMODASSERT(FMOD_System_CreateGeometry(mainsystem, 6, 24, &g));
*(geometry + curgeometry) = (DWORD)g;
curgeometry++;

float dxs,dxe,dys,dye,dzs,dze;
dxs = xs-x;
dxe = xe-x;
dys = ys-y;
dye = ye-y;
dzs = zs-z;
dze = ze-z;

FMOD_VECTOR cube[24] = //6 faces times 4 verts = 24
{
    { dxe, dys, dzs}, { dxe, dys,  dze}, { dxe,  dye,  dze}, { dxe,  dye, dzs}, //+X face
    {dxs, dys, dzs}, {dxs, dys,  dze}, {dxs,  dye,  dze}, {dxs,  dye, dzs}, //-X face
    {dxs,  dye, dzs}, { dxe,  dye, dzs}, { dxe,  dye,  dze}, {dxs,  dye,  dze}, //+Y face
    {dxs, dys, dzs}, { dxe, dys, dzs}, { dxe, dys,  dze}, {dxs, dys,  dze}, //-Y face
    {dxs, dys,  dze}, {dxs,  dye,  dze}, { dxe,  dye,  dze}, { dxe,  dys, dze}, //+Z face
    {dxs, dys, dzs}, {dxs,  dye, dzs}, { dxe,  dye, dzs}, { dxe, dys, dzs}, //-Z face
};

int pi = 0;
for(int i = 0; i < 5; ++i)
{
    FMOD_Geometry_AddPolygon(g, 1, 1, 1, 4, &cube [4 * i], &pi); 
}

FMOD_VECTOR v = {x,y,z};
FMODASSERT(FMOD_Geometry_SetPosition(g, &v));
return (double) (DWORD)g;

}
[/code:p1f8txmj]

I have not updated FMOD in a while. I have v 4.08.09

  • You must to post comments
0
0

Try setting the position twice in a row when you create it initially. Perhaps the system thinks the sound traveled very fast from a relative unknown position, causing the doppler to punch through. I use a dll of my own to wrap fmod so I’m no longer sure of the exact steps I took.

  • You must to post comments
0
0

Try the latest version as a small tweak to the geometry engine was made a while back. If it still happens see if you can provide some code which reproduces the issue.

  • You must to post comments
0
0

Brett – We have some cases where we have a similar issue: "I get a little bit of the sound when it starts when my listener is fully "occluded"… ", though we are not using geometric occlusion – just min/max radius of one-shot and looping sounds. But at the start of some sounds, we just get a little ‘pop’ of the sound at full volume, and then it attenuates…

  • You must to post comments
0
0

Thats no really possible unless you have mistakenly positioned your sound or not set the position correctly when it is in a paused state, and instead did it after. This thread is about geometry occlusion btw please don’t confuse the issue.

edit: Just in case there was a fix made when setChannelGroup was used and was timing related, that was in 4.8.10 or 4.10.00. If you’re using this function and an old version see if that is the issue.

  • You must to post comments
0
0

I don’t have time to recompile with 10 right now. I’ll do it in a few days.

http://host-a.net/icuurd12b42/GMFMODSimpleDemo.zip

At least I can demonstrate the artefact with the exe included in the zip.

I’m pretty sure I set the sound position and listenner positions properly… I used space then right click map to add a sound in the map and moved it arround very cautiously using the mouse… The listenner is at x,y,0 and the cubes are at x,y,0 and the sounds are at x,y,0. The cubes are the same size as what you see on screen though their loweer upper z are from -10 to 10… 20 units in height.

The horns and crash sound have a min max distance of 100,300, linear drop off.
The cops horn (siren) is 100,800

Ignore the first screen, just press N to go to the next demo which has occlusion…

Zoom out using the down arrow to see the blue area and drive inside it using asdw.

Perhaps Symbiotic can try it too to see if this effect was what he was experiencing…

the sound is started with pause ON, then FMOD_Channel_Set3DAttributes(channel,&pos,&vel) is called then the sound is unpaused.

Every step, the sounds are repositioned using FMOD_Channel_Set3DAttributes(channel,&pos,&vel)

At the end of every frame FMOD_Update is called

  • You must to post comments
0
0

Solved

Some sounds were played after set3DListenerAttributes.

Bug pcode
set listener x,y,z
play sound x,y,z
play sound x,y,z
play sound x,y,z
System Update

Fix pcode
play sound x,y,z
play sound x,y,z
play sound x,y,z
set listener x,y,z
System Update

  • You must to post comments
0
0

Hi there,

I’m having exactly the same problem as icuurd12b42 described at the start of this thread but I can’t work out why his solution solved the problem. Hopefully someone can straighten me out:

Basically, if I have a sound source which is playing whilst it goes between the listener and some occluding geometry it fades out nicely and everything’s great.

However, if a sound is created starting off behind an obstacle it starts off loud and then fades out to what it should be. I assume this something to do with the way blending is achieved when sound sources get occluded, like soft shadowing?

However, it spoils the experience quite a lot so I need to get the sound to start fully occluded. Can anyone tell me what I’m doing wrong?

Cheers

  • You must to post comments
0
0

Are you sure you set the listener position right before the update, after you started the sounds?

  • You must to post comments
0
0

Confident about listener pos as i’ve currently got it fixed in place so listener is stationary while sound making objects come and go.

I’m getting round it at the moment by ‘cueing up’ sounds as paused, moving them around and pausing/unpausing rather than spawning new sounds on an event.

It’s a pretty nasty hack though, I’d love to known what I’m doing wrong.

  • You must to post comments
0
0

Yes, I think I start the sound paused then move it to it’s playing position then unpause it. At that point it should work.

  • You must to post comments
0
0

The trouble is though I can’t create a sound paused, position it then immediately un-pause it or I get this fade out artefact.

It seems like I need to have the sound paused for long enough for it to ‘have faded out’ before I can start it playing.

So at the moment, when a game object that make noise is spawned I create its sounds paused and move them around with it so should one of them need to be played whilst behind a wall or something when I un-pause it it will be already by fully occluded.

I must be doing something out of order but I can’t figure out what.

The (non hack) sound loop goes roughly:

Check if any new sounds have been triggered
Call playSound to get a channel initially paused
Set all the sound properties including pos/vel
Set listener pos/vel
Call update

My search continues…

  • You must to post comments
Showing 11 results
Your Answer

Please first to submit.