Pretext: Thanks to Pennyworth for the assistance.
1. one can define **one** or **more** named selections in memory LOD of a model
2. probably works for any terrain object - so not limited to vegetation (trees, bushes); one can do with this things like rain, animals (insects, birds), wind related sounds, snow related sounds, water spring, church, clock, radio, buzzing, etc
3. the way it works the game looks for the name in CfgEnvSpatialSounds (subclass to EnvSounds in cfgWorlds terrain class - so can be/is terrain specific; or otherwise in cfgEnvSounds - a root base class)
class CfgWorlds
{
class DefaultWorld
{
class EnvSounds;
};
class CAWorld: DefaultWorld
{
};
class Tanoa: CAWorld
{
class EnvSounds: EnvSounds
{
class CfgEnvSpatialSounds
{
class sound_shrub_smallleaves_1
{
memPoint = "sound_shrub_smallleaves_1";
soundSets[] = {"Rain_PlantA_Light_SoundSet","Rain_PlantA_Medium_SoundSet","Rain_PlantA_Heavy_SoundSet","Insect_Day_SoundSet","Insect_Night_SoundSet"};
};
4. one assign multiple soundSets to the memory point placed in the model
class sound_shrub_smallleaves_1
{
memPoint = "sound_shrub_smallleaves_1";
soundSets[] = {"Rain_PlantA_Light_SoundSet","Rain_PlantA_Medium_SoundSet","Rain_PlantA_Heavy_SoundSet","Insect_Day_SoundSet","Insect_Night_SoundSet"};
};
5. the soundSet is assigns soundShaders (and various advanced sound parameters)
class Rain_PlantA_Medium_SoundSet
{
soundShaders[] = {"Rain_PlantA_Medium_SoundShader"};
volumeFactor = 1;
frequencyFactor = 0.6;
spatial = 1;
doppler = 0;
loop = 1;
volumeCurve = "InverseSquare1Curve";
sound3DProcessingType = "PLant3DProcessingType";
};
6. finally the soundShader has parameters to define under what conditions the sound is to be played (range + volume parameters)
class Rain_PlantA_Medium_SoundShader
{
samples[] = {{"A3\Sounds_F_Exp\environment\elements\rains\rain_plantA_medium_001",1},{"A3\Sounds_F_Exp\environment\elements\rains\rain_plantA_medium_002",1},{"A3\Sounds_F_Exp\environment\elements\rains\rain_plantA_medium_003",1}};
volume = "raindrops * raindrops * (rain factor[0.4,0.6])*(rain factor[0.9,0.7]) * 1.5";
range = 12;
};
---
List of memory points for vegetation by BI:
https://pastebin.com/dkRvTWYu
More detailed per model:
http://paste.ubuntu.com/23881406/
Script from Pennywise to visualize the memory points ingame:
https://gist.github.com/pennyworth12345/b335052d83a6b9ee70aef4a836767d56
(see image at the top for sample)
In regards to memory point positioning:
It does not have to be at the model center or at the base of the object.
Multiple memory points are fine too.
--
default CfgEnvSpatialSounds in CfgEnvSounds (used by DefaultWorld)
https://pastebin.ubuntu.com/25088136/
what Tanoa uses:
https://pastebin.ubuntu.com/25088141/
---
Full lists for spatialSound sounds:
CfgSoundSets:
https://pastebin.ubuntu.com/25087973/
CfgSoundShaders:
https://pastebin.ubuntu.com/25087974/