|
|
| Sound News | Press
Releases | Archives | Week In
Review | Editorials
| Articles | |
|
![]() |
|
||||
|
|||||
A Gamer's Guide to Direct Sound 3D and A3D 1.x Mikael Hagén - Last revised on: March 15, 2001
What does it mean that a game uses DS3D and/or A3D? I've seen a lot of confusion in newsgroups about what DS3D does especially compared to A3D, so I decided to write this short article to try to explain what DS3D does and doesn't do and in what ways it differs from A3D. The article was originally written when DirectX6 was the latest versions. At the end of the article you will find a short update what's new in DirectX7 and DirectX8. Introduction to DS3D and 3D sound hardware Microsoft provides DirectSound3D (DS3D from now on) as one of the components in the DirectX family, just like the more famous D3D which is used for 3D graphics. One thing that DS3D allows that D3D doesn't, is extensions such as Creative's EAX. The lack of extensions is one major reason why some developers prefer OpenGL over D3D. DS3D is basically a bunch of commands (API) that help game developers define where the sound should be placed in the 3D space and how loud it should be. The location where each sound should be placed is then passed on to your DS3D capable soundcard which uses some clever algorithms to place the sound in 3D space. How well you will be able to locate the sound depends on the algorithms your soundcard uses, if you use headphones, 2 or 4 speakers and yourself. That is, how well it works is very subjective. If you don't have a DS3D capable soundcard, MS has provided a rather simple software 3D sound engine that is both CPU hungry, and not very good on placing the sound (that is, you will have problems trying determine where the sound is coming from). Because of these limitations, the programmer usually mixes to stereo or some other software 3D engine like Intel's RSX or QSound's QMixer if you don't have a 3D sound card. If the soundcard supports DS3D it doesn't necessarily mean it will not use your CPU for the 3D processing, but it will use the 3D algorithms your soundcard maker either developed or licensed (usually from Aureal, CRL or QSound). These algorithms are usually both better at placing the 3D sound correctly and less CPU hungry. What complicates the picture is that most soundcards can't accelerate more than a fixed number of 3D streams, after which it falls back on to using the MS 3D sound engine or non-3D sound. To stop this from happening, the developer tries to only use 3D sound for the most important sound sources like monsters and not for background sounds. Playing new games like Unreal which uses 16 3D voices, an original Monstersound card that only supports 8 3D voices can cause the sound from your gun to suddenly change. What happens is the sound isn't using Aureal's 3D sound algorithms anymore. Positions, speed and Doppler effects The developer must at least set the position (in the 3D room) for each sound source (e.g. monsters, rockets, bullets, insects) and the position and direction of the listener, that is you. They usually also choose the speed of the sound sources and the listener. That speed is only used to calculate the Doppler effect and doesn't need to be the real speed of the listener and sound sources. The developer can also choose the Doppler factor from anything between 0-10, where 0 means no Doppler effect will be calculated and 1 will result in a realistic Doppler effect. Anything above that will cause an unrealistic but maybe more exciting Doppler effect. Volume and how DS3D determines the distance A sound source must also have a volume. In the real world the sound source will be louder as it gets closer, but that isn't possible to do in a game and neither is it desirable. If you take an aircraft, you want it to be loud at about 3000 feet away and very loud 300 feet away but you can't (nor want to) produce the realistic loudness of the aircraft only 10 feet away, if that would happen in a game. Another difference in a game is that all sounds are recorded at about the same volume because of the limitation of 16-bit audio. That is, 16-bit audio doesn't have enough room to contain such different volume levels. In DS3D, developers choose for each sound source a minimum distance where you play the sound at the maximum volume, if the sound source moves closer the volume will stay the same. For an insect the minimum distance could be 1 inch while the aircraft could have a minimum distance of 300 feet. How fast the volume is reduced (attenuation of the volume) depends on the roll off factor (which is the same for all sound sources) but usually the sound is half the maximum volume at twice the distance. In the case of the insect that would mean that already 4 inches away it's only 1/10 of the maximum volume and would almost be silent. For each sound source, the developer also specifies a maximum distance. The developer can choose if the sound source should be either quiet when they are further away than the maximum distance or stay at the same volume level, that is if they had 10% of maximum volume at the maximum distance they will continue to have that volume further away. If the developer chooses a maximum distance for a sound source where you still can hear it easily, the sound source will either stop abruptly when it reaches the maximum distance away from you, or you'll hear it through the entire level. Sound cones The above example of volume for sound sources treated them like a point source (that is they spread the sound equally in all directions) but it's possible to give the sound a direction. To do that, the developer specifies an inside and outside cone for the sound source. Within the inside cone, the sound is at the maximum volume (at that distance). Outside the outside cone, the volume is whatever the developer choose (or rather how much you should reduce the volume further than DS3D already done because of the distance from the listener) and between the cones the volume changes gradually. Sound cones can be used to just enhance the realism of the audio or more usually to do cool effects like this example from the DS3D documentation: "Designing sound cones properly can add dramatic effects to your application. For example, you could position the sound source in the center of a room, setting its orientation toward a door. Then set the angle of the outside cone so that it extends to the width of the doorway and set the outside cone volume to inaudible. The user, when passing the open door, will suddenly hear the voice emanating from the room." How does A3D differ from DS3D? To know why A3D was developed you need to know a bit of history. When Microsoft released DS3D with DirectX3, the summer 96 (if I remember correctly), they didn't offer any hardware acceleration and hinted that even if they later would offer that, they wanted everyone to use their algorithms. Aureal didn't want to use Microsoft's 3D algorithms and they wanted the possibility to accelerate the 3D streams but still use the same 3D sound commands (API), the result of their work was A3D. Aureal also released some tools to make life easier for developers to include 3D sound in their titles. That together with soundcards released using Aureal's 3D sound algorithms without taxing the CPU too much, was enough to make some developers start to include 3D sound in their titles (something no one did using MS DirectX3 3D sound engine). Later MS changed their mind and released DirectX5 the summer/fall 97 that included a new DS3D with ability for soundcard companies to accelerate 3D streams in hardware using their own algorithms. So doesn't A3D 1.X offer anything more than DS3D? Yes it does offer 3 more things. The most important is a voice manager (Aureal's name for it is resource manager) that helps the developers to manage the 3D streams and take better advantage of the number of 3D streams that the card can handle, that is, choose the most important sound sources to be using Aureal's 3D sound algorithms. The rest of the sound sources are either not played at all or played using the stereo mixer, usually the latter. This doesn't completely remove the problems I mentioned above in Unreal but should at least reduce them. By how much depends on the developers and how many sound sources they use in the game. The other improvement A3D 1.X has is a more advanced distance model where they have a high frequency distance factor the developer can manipulate to simulate different atmospheric environments, such as thick fog or underwater. Finally the developer can find out more details about the A3D hardware that it uses including what drivers are used. There is now a voice manager for DS3D that QSound made as an
extension to DS3D and gave to MS. MS later made some changes to that extension after
feedback from companies like Creative and published it as an official voice manager
extension that all soundcard companies could support if they wanted to. The Live and
all soundcards using QSound's and Sensauras 3d
technology support this voice manager. What's new in DirectX7 In DirectX7 the only real change is that the new voicemanager and a new software 3D sound engine. The new 3D sound engine offers 3 modes, stereo panning, HRTF light, HRTF full. As the name suggests the first is just stereo panning while the 2 others are really 3D sound engines using HRTF filters just like Sensaura, Aureal's and Creative's 3D sound engines. All old games will end up using the stereo panning while new games can choose to use the light or full HRTF engine. However regardless what the games choose VXD drivers will always end up using the stereo panning mode. In case you don't know Windows2000 only use the WDM format while WindowsME and Windows98SE supports both VXD and WDM drivers. Most soundcards only offers WDM drivers for Windows 200 and WindowsME and some doesn't even offer WDM drivers for WindowsME. The new stereo panning algorithms are much quicker than the old 3D sound engine which is why you will see much better results when using Directx7 than DirectX6 in ZD AudioWinbench with soundcards that support less than 32 3D streams in hardware. In actual games you are unlikely to see a performance benefit since most if not all games either dropped sound effects or use their own stereo panning algorithms for the 3D streams that the soundcard can't handle. Few if any game force the use of the full HRTF mode but some offers it as an option which will benefit users of soundcards that doesn't support 3D sound. What's new in DirectX8 DirectX8 includes plenty of new features that we may go into more
detail in a future article. The new features will definetely be of great benefit to the
developers but when it comes to 3D audio no driver changes is required. Here's the
hi-lights from the press release when
it comes to 3D audio:
For other new DirectX features (including audio) you can check out The Cold Shop's DirectX8 article or Computer Games Online short overview of the new features in DirectX. Here's snip from the audio portion of Computer Games Online's article:
If you have any comments, questions or see any errors in the article contact Mikael@3dsoundsurge.com Related articles Have comments or questions on this feature?
|
Articles A Gamer's Guide to Sensaura 3D Audio A Gamer's Guide to 3D Sound and Reverb APIs A Gamer's Guide to 3D Sound and Reverb Engines A Gamer's Guide to DS3D and A3D 1.x Virtual Surround Sound Technologies The Advantages of the Center and LFE channels Stereo to 4 or 5.1 Expansion Technologies |
|