Sounds and Merged Meshes

Sounds and Merged Meshes

CRYENGINE allows the useage of Merged Meshes for patches of vegetation. However, in order for Merged Meshes to be calculated and therefore used with sound, the relevant CVar must be set in the system.cfg file. To do this set the CVar g_enableMergedMeshRuntimeAreas=1

By default the Merged Mesh feature is disabled - this avoids unnecessary calculations when the feature is not required.

The MergedMeshSurfaceTypes.xml

The Merged Mesh vegetation feature uses the Surface Type of the vegetation in question.

When entering a Merged Mesh vegetation patch the system looks up the Surface Type in an xml file named MergedMeshSurfaceTypes.xml. This xml file is located in: <Game_Folder>/Libs/MaterialEffects

Within this xml file you can specify an ATL-Trigger and an ATL-RTPC per surface.

Once you enter a Merged Mesh vegetation patch, and based on its assigned Surface Type the ATL-Trigger defined in the xml file will be executed and the ATL-RTPC updated according to the density of the vegetation.

As opposed to audio during collisions through the vegetation.xml, audio for Merged Meshes is played on the entity that is moving through the patch of vegetation and therefore the object_speed ATL-RTPC of the entity can be set on the playing vegetation loop. This allows you to control the volume of the vegetation loop according to the density of the vegetation and the speed of the moving entity.

In the example above, which is taken from the MergedMeshSurfaceTypes.xml, we have specified the ATL-Trigger Play_p_veg_mm_grass that will be executed when entering a patch of vegetation with the SurfaceType mat_grass. The ATL-RTPC mm_grass_density is updated according to the density of the vegetation in question.

As soon as you enter the patch of vegetation the setup in your Audio-Middleware should trigger a looping sound. Volume and other parameters can be altered, but this will depend on the connected Middleware-Controls, the mm_grass_density ATL-RTPC and the object_speed ATL-RTPC.

Examples

An example audio setup for Merged Meshes can be found in the CRYENGINE Sandbox Editor showcase levels and in the Wwise Project DLC.