バージョン

menu_open
Wwise SDK 2023.1.3
Geometry APIを使った回折(diffraction)と透過(transmission)のシミュレーション

はじめに

Wwise Spatial Audioに送信したジオメトリを、音の回折や透過のシミュレーションに使うことがあります。つまり、あなたのゲームエンジンでオブストラクションを計算するレイキャスト方式を、完全に置き換えることも可能です。

エミッタが障害物に隠れてリスナーから見えないとき、Spatial Audioが障害物のエッジ(端)にそってパスを計算し、見つかれば、その端を回り込む音によって発生する回折係数を計算します。これに合わせてエミッタの見かけの入射角が調整され、回折値がWwiseに送信されるので、最終的に音にどう影響するかをあなたがWwiseでコントロールできます。回折の結果としてローパスフィルターが適用されるのが一般的です。

さらに、Spatial Audioはジオメトリを通るサウンドパスを計算します。障害物を透過する音には、API経由でジオメトリにアサインされた表面プロパティで決まる透過損失(transmission loss)の係数が適用されます。透過損失は、ローパスフィルタとボリューム減衰でモデル化されるのが一般的です。

下図は、WwiseのGame Object 3D Viewerのスクリーンショットです。ある音の、薄い壁の周りを回折する回折パスと、透過損失100の透過パスが示されています。

警告: 障害の計算方法として、あなたのゲームエンジンのレイキャスト方式から、ジオメトリを使った回折と透過に、完全に切り替えることは可能ですが、ジオメトリが複雑になるとパフォーマンスコストが急速に増大します。Spatial Audioに送信するジオメトリは、できるだけシンプルにしてください。また、効率的なRooms and Portalsによる抽象化( RoomとPortal 参照)を、ジオメトリによる回折と合わせて利用した方が、後者の複雑な計算を減らせます。

Reflectと組み合わせて使えば、ジオメトリによる回折をエミッタとリスナーの間の直接的な音の伝播のパスだけでなく、その初期反射のパスに対しても適用できます。

回折用(diffraction)に、ジオメトリを設定する

Spatial Audioに送信されるジオメトリセットはすべて、回折のパスを計算するときに考慮するべきかどうかを明確に示す必要があります。明示するには、AkGeometryParams::EnableDiffraction フラグを使います。このフラグが回折の計算に必要なエッジデータ生成を可能にし、ダイレクトパスに対するジオメトリによるディフラクションと、リフレクションのディフラクションの、両方で使われます。

また、メッシュの境界エッジでも音が回折するのかどうかを検討します。メッシュの境界エッジとは、1つの三角形だけにつながるエッジのことで、多様体の境界に存在することになります。エッジ数が増えると回折の計算がより複雑になるので、あなたのメッシュの境界エッジで音が回折しないのであれば、このオプションを無効にしておきます。

最後に、エッジ材質はエネルギーを吸収せず、Acoustic Surfaceに設定されているAcoustic Textureは回折に一切影響しません。エッジは、音を単に曲げるだけです。

透過(transmission)用に、ジオメトリを設定する

音の透過のために、ジオメトリのセットアップで特に必要な追加の手順はありませんが、様々なジオメトリタイプに合わせて透過損失(transmission loss)の係数を調整したほうが良いと思われます。例えばコンクリート構造は、ほぼすべての音響透過を妨げる可能性が高いのに対し、ベニヤ板で構成されたジオメトリは、わずかに音を妨げるだけかもしれません。

AkGeometryParams::Triangles アレイの中の各 AkTriangle に、 AkTriangle::surface が入っていますが、これは AkGeometryParams::Surfaces アレイに対するインデックスです。 AkAcousticSurface::transmissionLoss フィールドは、それを参照する三角形を透過する音に対し、どれだけの透過損失を適用すべきかを表します。値は0から1の間で設定されます。The transmission loss is converted to a percentage and then used to evaluate Wwise curves. The final volume attenuation and filter value applied to a sound with a given transmission loss will depend on the curves defined in the project. By default, the project occlusion curve is used. Custom transmission curves can be created in the Attenuation ShareSet added to the sound. 透過損失を組み込みパラメータとして適用したり、RTPCにマッピングしたりすることもできます。

ダイレクトパスの、ジオメトリによる回折

Refer to the Geometric Diffraction demo and its code in the Integration Demoサンプル (in SDK/samples/IntegrationDemo) for an example of using geometry for the purpose of geometric diffraction of the direct path. Look for Spatial Audio Demos > Geometry Demo.

回折(diffraction)と透過(transmission)のために音を準備する

Wwise AuthoringツールのPositioningタブで、 Enable Diffraction and Transmission がチェックされていることを確認します。このボックスは、回折や透過に関するSpatial Audio機能を有効にするもので、例えば以下が可能となります。

  • 音の回折パスがジオメトリやポータルを経由する場合は、その計算。パスの計算は、Spatial Audioが、回折と透過を有効にしたサウンドを再生している各ゲームオブジェクトに対し、行います。同じゲームオブジェクト上で、回折を有効にした複数のサウンドが再生中であれば、パス計算は1回だけ行われます。
  • ジオメトリやルーム間を経由する音の透過パスの計算。透過パス上で遭遇した透過損失値のうち、ルームの AkRoomParams::transmissionLoss や、三角形に関連付けられた AkAcousticSurface::TransmissionLoss のうち、必ず最大の透過損失値が、最終的な透過損失係数として用いられます。
  • Spatial Audioの初期設定で AkSpatialAudioInitSettings::bCalcEmitterVirtualPosition が設定されていれば、音をレンダリングするために回折パスのバーチャルポジションを生成してSound Engineに送ります。
  • Application of curves according to the diffraction coefficient and the transmission loss coefficient.

By default, the project obstruction curves are used for diffraction and the project occlusion curves are used for transmission. If the game has also set an obstruction or occlusion value via AK::SoundEngine::SetObjectObstructionAndOcclusion, the values will be added.

Custom curves for diffraction and transmission can be created by adding an Attenuation ShareSet to the sound. Use the Attenuation Editor to create custom curves on Volume, LPF and HPF and fine-tune them while monitoring. For more information, refer to the Applying Attenuation section of the Wwise Help.

Wwiseにおけるダイレクトパスの回折と透過

回折と透過の様子をGame Object 3D Viewerで観察するには、Profiler Settingsやビュア―のオプションで設定します(下図参照)。

エミッタからリスナーまでのパスで計算された回折係数が、回折エッジごとに表示されます。組み込みゲームパラメータ値はバインドされているゲームパラメータをGame Sync Monitorに追加することでプロファイリングでき、オブストラクションやディフラクションはProfilerのObs/Occタブでプロファイリングできます。

計算した透過損失係数は、Game Object 3D Viewerで、該当する透過パスの隣に表示されます。透過損失の原因がジオメトリであれば、ヒットポイントが、その透過損失率()と共に示されます。一方、透過損失の原因がルームであれば、透過損失率が表示され、その下に文字で"(Room)"と表示されます。

Portalsと同じく、Diffraction値はエミッタがリスナーの視界に入っているときに0で、エミッタがシャドーゾーンを貫通し始めると増加します(Diffraction(回折) 参照)。Also, please refer to Rooms and Portals' Diffraction(回折) for more details on shadow zone diffraction and for a discussion about using curves versus the Built-in Diffraction Game Parameter.

ダイレクトパスの回折と、Spatial AudioのRooms and Portalsの関係

Spatial AudioのRooms and Portals( RoomとPortal )でも、隣接するルームのダイレクトサウンドの回折をPortalsによってモデル化します。これら2つのシステムは補完し合う関係で、リスナーと同じ部屋にないエミッタに対して、ジオメトリに基づく回折パスを見つけようとすることはありません。ジオメトリよりもRooms and Portalsの計算の方がかなり効率的なことを考慮すると、複雑な計算を制限するために、2つのシステムを併用することにメリットがあります。

アーリーリフレクションの、ジオメトリによる回折

Refer to the Reflect Diffraction demo and its code in the Integration Demoサンプル (in SDK/samples/IntegrationDemo) for an example of using geometry for the purpose of geometric diffraction of Early Reflections. Look for Spatial Audio Demos > Reflect Demo.

上記の通りアーリーリフレクションはエッジで回折することがあり、エミッタをReflectにルーティングすると、Spatial Audioがこの現象のモデル化をサポートします。

その方法を説明する前に、ビューゾーン内の回折を定義する必要があります。

下図をご覧ください。エミッタはリスナーの視界に入っていますが、鏡面反射がリスナーに当たっていません。つまり、ビューゾーンに入っているのです。すでに Diffraction(回折) で説明した通り、回折はビューゾーン内でも発生します。ただしWwise Spatial Audioでは、ダイレクトパスのモデル化を行うRooms and Portalsでもジオメトリによる回折でも、ビューゾーン内の回折が実際のダイレクトパスと比較して無視できる程度なので、考慮されません。しかし反射に関しては、ビューゾーンの回折が劇的な影響をもっています。回折がないとアーリーリフレクションが聞こえるのはリフレクションゾーン内だけで、そこでは純粋な鏡面反射となっています。リスナーがビューゾーンに入った途端、反射が聞こえなくなります。回折を有効にしておけば、エッジが作用して反射波が回折されます。そうすると、リスナーがリフレクションゾーン内を歩き回ったり、そこを遠ざかったりしたときに、追加のフィルタリングや減衰が適用されたあとの反射を聞くことができるのです。

In the reflection zone, there is no diffracted path and, therefore, no diffraction value is calculated, because the specular reflection is assumed to take over. あるエッジにおけるビューゾーンの回折を計算すると、リフレクションゾーンとビューゾーンの境界線において0となり、ビューゾーンとシャドーゾーンの境界線において100となります。

高次のアーリーリフレクションでは、ビューゾーンとシャドーゾーンの両方の回折が作用します。

サウンドにReflectionを適用するには

リフレクションを要するすべてのサウンド用に、Wwise Authoringツールで、Reflectの入ったAuxバスにアーリーリフレクションのセンドを設定します。詳細は Wwiseプロジェクトセットアップ を参照してください。反射の回折を目的とする回折の特別な設定はなく、ジオメトリに対して回折を有効にするだけで充分です。

Reflectの設定

回折エフェクトを適用した反射は、Reflectでイメージソースとして表示されます。反射の回折のエフェクトをデザインするのに、回折で変化する3つのカーブ、つまりDiffraction Attenuation、Diffraction LPF、Diffraction HPFを使うことができます。詳細は Reflect's documentation を参照してください。

ジオメトリのAPIとルームやポータルを、合わせて使う

Wwise Spatial Audioのルームやポータルは、ジオメトリAPIと連動して反射や回折を表現します。ルームやポータルのネットワークを、周辺のジオメトリのハイレベルの抽象化(またはLOD(Level of Detail)の低レベルバージョン)としてとらえることができます。ルームやポータルを、レベルのジオメトリと注意深く合わせて使えば、詳細で効率的な音響シミュレーションを達成できます。

ポータルを通過するジオメトリによる回折

エミッタ(ジオメトリ回折用に正しく設定されたサウンドを再生中のエミッタ、 回折(diffraction)と透過(transmission)のために音を準備する 参照)が、リスナーと同じルームにない場合、ジオメトリによるパスを以下のように計算します:

  • エミッタからリスナーまでの音の伝播パスを、ルームとポータルのネットワークを使い計算します。
  • 各パスの、エミッタに最も近いポータルとエミッタの間の部分は、ジオメトリの回折アルゴリズムを使い、まるでポータルがリスナーであるかのように計算します。リスナーから見て、エミッタが1つのポータルの真後ろにいない限り、計算されるジオメトリパスは1つ(最短のもの)だけです。それ以外にエミッタとポータルのパスをいくつ計算しても、別のバーチャルポジションが出るわけではないので、不要です。
  • 2つのポータルの間も、ポータル同士で直視できなければ、ジオメトリによる回折を使い、間のパスを計算します。これらの計算は、シーンにジオメトリやポータルが追加されたり削除されたりする度に行い、必要に応じて再利用します。多くの場合、2つのポータルの間の最短パスだけを使います。唯一、リスナーがポータルの真後ろにいるときが例外で、その場合は複数のパスを用い、リスナーがポータルを通過した際の中断を回避します。
  • 各パスの、リスナーに最も近いポータルとリスナーの間の部分は、ジオメトリに従った回折アルゴリズムを使い、まるでポータルがエミッタであるかのように計算します。
  • 以上のパスを組み合わせた結果がパスとなり、必要に応じて複数のパスをつなげたり合体させたりします。

ポータルを通過する反射

Reflections can pass through portals and can reflect off of walls on either or both sides of the portal. Reflections can pass through more than one portal, possibly reflecting on surfaces between them if the reflection order is high enough (refer to AkSpatialAudioInitSettings::uMaxReflectionOrder). To ensure smooth reflections through portals, we recommend that you set AkSpatialAudioInitSettings::uDiffractionOnReflectionsOrder to at least 2, but be aware that increasing this setting also increases CPU usage.

Because the portal itself describes an acoustic opening, it is not necessary to also "cut holes" in the triangle geometry to allow a sound to pass through, which would greatly increase the number of triangles. A portal box represents negative space, so remember that any geometry that intersects a portal is effectively ignored, for example in a room where the geometry is described by a box, with two triangles for each of the six sides. To ensure that sound can propagate outside the box, add a portal that intersects one of the walls along the portal's z-axis.

警告: For reflections to be accurately calculated on each side of a portal, set AkGeometryInstanceParams::RoomID to an invalid AkRoomID. Unlike diffraction, reflection paths through portals are not calculated independently for each room and then later combined. Instead, reflections are calculated exactly as if the emitter and listener were in the same room, and the portal is treated as a hole in the geometry.

ルームの間のポータルを、ジオメトリを使って方向を決めるヒント

下図は、方向が正しく設定されたポータルの例です。

  • Geometry cut-outs allow reflection and diffraction paths to pass through the portal.
  • A rectangular opening is subtracted from any geometry overlapped by the portal.
  • Geometry cut-outs are drawn in the Game Object 3D Viewer with a dark green outline.
  • For correct cut-out detection, the planes intersected by the portal must be non-intersecting (but not necessarily parallel), and they both must span the entire width (X) and height (Y) of the portal.
  • 2つの平面の間や、ポータルで接続する2つのルームの間に、隙間があることは許容されます。ただし、ゲームオブジェクトがポータルに入ることができるのは、接続するルームのどちらかに、それが事前にあった場合のみです。
  • ゲームオブジェクトがポータルを通過してトランジションする場合は、 AK::SpatialAudio::SetGameObjectInRoom に渡されるルームのコンテイメント結果は、ヒントとして使うだけです。The exact room is determined by projecting the game object's position onto the portal's Z-axis, and then testing if the game object is in the front-half or back-half of the portal, corresponding to the front and back rooms respectively.
  • The portal does not need to be perfectly aligned and centered between the two rooms.
  • The transition point between two rooms is the center of the cut-out. When there is a gap between the two planes, the transition point is the center of the area between the two cut-outs.

  • 2つのルーム間を滑らかにトランジションできるだけの深さがZ軸にそって確保できるようにしてください。
  • 2つのルーム間のトランジションが唐突すぎる場合は、Z軸に沿ってポータルを長くすることで解決できることが多いです。

Tagging Geometry for Specific Rooms (Diffraction Only).

警告: AkGeometryInstanceParams::RoomID is deprecated and the parameter will be removed in a future version. We recommend that you do not use RoomID, and instead leave it set to the default value (-1).

As an optimization, assign AkGeometryInstanceParams::RoomID if all of the following conditions apply:

  • Geometry is physically located in one room exclusively.
  • Portals are used primarily for diffraction and sound propagation of reverb.
  • Having accurate reflections pass through portals is not required.
  • The Room referenced by AkGeometryInstanceParams::RoomID is not a Reverb Zone, nor is it a parent room of a Reverb Zone. In this case, AkGeometryInstanceParams::RoomID is ignored. For more information about Reverb Zones, refer to Using Reverb Zones.

To limit the search space for ray-triangle intersection tests, you can manually assign geometry to specific rooms. まず、そのルームのIDに、 AkGeometryInstanceParams::RoomID を設定します。This indicates to Spatial Audio that the Geometry Instance in that room is only visible from other rooms through portals and not directly. Because a single Geometry Instance can only be associated with one room ID, a room cannot have geometry that is visible in multiple rooms unless AkGeometryInstanceParams::RoomID is invalid. Also note that if any geometry set is associated with a particular room ID, then that room can no longer "see" geometry that is not explicitly associated with that room. After you assign a Geometry Instance to a room, Spatial Audio only looks for geometry that is specifically associated with that room ID when it simulates reflection and diffraction in that room.


このページはお役に立ちましたか?

サポートは必要ですか?

ご質問や問題、ご不明点はございますか?お気軽にお問い合わせください。

サポートページをご確認ください

あなたのプロジェクトについて教えてください。ご不明な点はありませんか。

プロジェクトを登録していただくことで、ご利用開始のサポートをいたします。

Wwiseからはじめよう