Friday, September 12, 2008

Sound Geometry And Occlusion

hi, i added sound occlusion effect which takes scene geometry into consideration when trying to play sound with his properties.
i created new class called CSoundGeometry which contains the geometry the sound need to consider when we are playing it.
all sound geometry classes separated by material properties so i can give different sound occlusion and reverberation properties based on the material.
for example: stone will occlude more sound then glass.
for now i didn't setup the properties table for each material, so every material will block the sound in 100% (so no reverberation for now).
i added debug rendering for the sounds so i know when sound is occlude and how much by rendering red to green color circle interpolated from the min to max distance property of the sound, so if the sound have 10 to 100 (min, max distance) and it is occluded it is shown in red, if not it is shown in green, if it is 50% occluded it is shown a circle radius of 45 and with 50% color between red and green.
note that only one room has sound in it so only when the door is opened we can hear it, you can also hear the steps sound and gear when you are moving.
the door also have few sounds for few states: open/opened/closes/locked
here is screenshots and short movie that shows sound occlusion in action.

sounds shown in green spheres, occluded sounds in red

min/max distances of sounds shown in green circles, occluded sounds in red
the door is opened at 50% so the top sound is occluded 50% meaning 50% between red to green

No comments: