Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

make walls block sound -- use occlusion culling?

Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
10-04-2006 11:07
I saw another request for the much-wanted feature of making walls block sound. People would like to be able to sit in their home and not hear the griefer outside with the megaphone.

Many programmers, me included, have talked here in the forums about how hard sound occlusion would be to implement. It's just not easy to determine what 3d objects are in the way between you and some sound source.

...except, the client does that now, with occlusion culling!

So here's what I propose: simply piggyback sound muffling onto the existing occlusion culling system. If users enable the "sound muffling" option, which requires occlusion culling to be enabled, then any time a sound source gets culled from their screen, the corresponding sound should be attenuated and "muffled". Maybe apply quick(?) low-pass filter to make a sound muddy.

There are problems. For example, I don't think the occlusion culling can tell "how" occluded an object is. That means that it wouldn't really be possible to muffle a sound more if ten walls are in the way rather than just one.

Also, transparent walls wouldn't muffle sound. You'd still be able to hear someone typing through your glass windows.

Even still, in a majority of cases, with some careful tuning, I think this might well closely approximate actual sound muffling. You could do some kind of exponential increase in muffling (decrease in volume) as a culled sound source gets further away. Any techies with thoughts?
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
10-04-2006 11:58
Not only would transparent prims not cull sounds, neither would any prims textured with any 32-bit textures. Invisiprims, however, would. On top of that, sounds from prims immediately on the other side of the wall may or may not be culled depending on where they were in the octree.

Plus sound doesn't travel like light. The long wavelength means that objects need to be significantly larger to cull sounds, so small barriers that produce short-term object culling would have weird effects on sounds.

If they would just let us script how far away we can hear sounds, you could create a scripted object to place in a room to change how audible objects outside the room are. This would be much more versatile than trying to get prims and sounds to interact.
Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
10-04-2006 12:52
Not to mention SL applies culling to everything off your screen automatically, so if the sound does not originate from within your field of view, you won't hear it. An avatar standing beside or behind and just off your screen wouldn't be heard, which is very odd behaviour :P
_____________________
Computer (Mac Pro):
2 x Quad Core 3.2ghz Xeon
10gb DDR2 800mhz FB-DIMMS
4 x 750gb, 32mb cache hard-drives (RAID-0/striped)
NVidia GeForce 8800GT (512mb)
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
10-05-2006 10:07
From: Haravikk Mistral
Not to mention SL applies culling to everything off your screen automatically, so if the sound does not originate from within your field of view, you won't hear it. An avatar standing beside or behind and just off your screen wouldn't be heard, which is very odd behaviour :P


Oops, good point. Ah well.
Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
10-05-2006 10:42
I know, 'tis a bit annoying :(
Actually though, Argent didn't you suggest something else? Still not perfect, but it was something like drawing lines from an object emitting sound (done client side) to the corners of your avatar's bounding box. Or even just a single direct line if necessary. If any of these lines intersect an object marked as "Blocks sound" or that is set to some new material type, then that line is marked as blocked. If all lines are blocked, then you won't hear that sound, speech or whatever.
It doesn't defeat the fact that sound would realistically travel around objects in the way, but with it being applied only to a certain material or objects with a specific flag set, then it shouldn't be a problem, as builders shouldn't be using these on things like pillars, but on house-walls it would be a good use.
_____________________
Computer (Mac Pro):
2 x Quad Core 3.2ghz Xeon
10gb DDR2 800mhz FB-DIMMS
4 x 750gb, 32mb cache hard-drives (RAID-0/striped)
NVidia GeForce 8800GT (512mb)
Kyrah Abattoir
cruelty delight
Join date: 4 Jun 2004
Posts: 2,786
10-05-2006 16:06
its called raytracing, its slow, and one of the reasons why we bother with occlusion culling rather than raytracing
_____________________

tired of XStreetSL? try those!
apez http://tinyurl.com/yfm9d5b
metalife http://tinyurl.com/yzm3yvw
metaverse exchange http://tinyurl.com/yzh7j4a
slapt http://tinyurl.com/yfqah9u
Gearsawe Stonecutter
Over there
Join date: 14 Sep 2005
Posts: 614
10-06-2006 06:28
From: Argent Stonecutter
...
If they would just let us script how far away we can hear sounds, you could create a scripted object to place in a room to change how audible objects outside the room are. This would be much more versatile than trying to get prims and sounds to interact.

for now we are limited to using llTriggerSoundLimited. but then there is that weird one llSetSoundRadius which sounds like a great idea but does nothing.

I just would have concerns with that same culling as that used for objects. Culling is not 100%. So as you move around you would have sounds cutting in and out.
Draco18s Majestic
Registered User
Join date: 19 Sep 2005
Posts: 2,744
10-08-2006 09:04
From: Kyrah Abattoir
its called raytracing, its slow, and one of the reasons why we bother with occlusion culling rather than raytracing


Yup, and that's what I said when it was first suggested.
Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
10-08-2006 09:40
But if you super-simplify to only drawing lines between the emitting objects (speaking or making noise) and your avatar, on the client end. And have it only block the sound if there is a specific material object blocking the line, then you've got a perfectly workable system. Semi-intelligent use of the new "Soundproof" material would then result in houses that block sound, or hotel rooms or whatever.
_____________________
Computer (Mac Pro):
2 x Quad Core 3.2ghz Xeon
10gb DDR2 800mhz FB-DIMMS
4 x 750gb, 32mb cache hard-drives (RAID-0/striped)
NVidia GeForce 8800GT (512mb)
Kyrah Abattoir
cruelty delight
Join date: 4 Jun 2004
Posts: 2,786
10-08-2006 10:44
raytracing ---> slow

it still will have to analyze the geometries between thze two objects
_____________________

tired of XStreetSL? try those!
apez http://tinyurl.com/yfm9d5b
metalife http://tinyurl.com/yzm3yvw
metaverse exchange http://tinyurl.com/yzh7j4a
slapt http://tinyurl.com/yfqah9u
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
10-08-2006 11:22
From: Haravikk Mistral
...if there is a specific material object blocking the line...


...and do that check multiple times for every sound source. I don't think it'd be that easy to check tens to hundreds of sound sources against thousands of prims in a scene. The math involved would be prohibitively computationally expensive. That's why I tried to look for an easy way out with the existing occlusion culling system (which I believe is tied to asking the video card to "watch" the rendering process, not ray-tracing).
Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
10-08-2006 14:41
How many sims out there have thousands of sound sources? I've rarely encountered more than 3 in a 100m radius =S
It only needs to do dirty checking; if a prim is within 5m of the line to you, is sound-proof, and is big enough to intersect your line (assuming a cube shape for all prim types) then the sound is blocked. As I say, it's a tool for builders rather than a perfect system that can realistically do sound.

It's a system of:
- Sound proof wall in way?
- BLOCKED!

That's it, not very complicated at all. No refraction (iirc that's the right word), no dampening, no muffled noise. In a busy area you'd be talking about maybe 50 'rays' to trace at most, that being a big group of avatars and some objects. Make it optional if it turns out to be a bit intensive anyway, but it's very unlikely.

Alternatives include some kind of zoning, like this thread
_____________________
Computer (Mac Pro):
2 x Quad Core 3.2ghz Xeon
10gb DDR2 800mhz FB-DIMMS
4 x 750gb, 32mb cache hard-drives (RAID-0/striped)
NVidia GeForce 8800GT (512mb)
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
10-08-2006 19:13
I'm with my cousin Gearsawe, they need to make llSetSoundRadius work.