VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Attributes
makVrv::DtProceduralSoundscapeChannel Struct Reference

Configuration for one ambient sound channel.

An ambient sound channel pairs a looping sound file with an osgEarth FeatureSource layer. Each tick the DtProceduralSoundscapeManager queries the layer around the observer's position and uses the signed distance to the nearest matching polygon to modulate the channel's decibel level.

The same struct is used for all ambient sound types (water, forest, city, etc.). The name field is the caller-defined identifier used for removal.

Public Attributes

std::string name
 
std::string soundFile
 
std::string featureLayerName
 
std::vector< DtAttributeFilter > attributeFilters
 
std::vector< DtElevationCondition > elevationConditions
 
boost::optional< DtRasterSource > rasterSource
 
float densityScale = 1.0f
 
double fadeDistanceMeters = 500.0
 
double queryRadiusMeters = 5000.0
 
std::string behaviorKey
 
bool featureProximityEnabled = false
 
bool precipitationBehaviorEnabled = false
 
std::map< std::string,
std::string > 
precipitationBehaviorParams
 
bool windBehaviorEnabled = false
 
std::map< std::string,
std::string > 
windBehaviorParams
 
bool modelSet3dModelsEnabled = true
 
bool modelSet3dColorizedEnabled = true
 
bool modelSet2dIconsEnabled = true
 
bool precipitationLocalWeatherAreaEnabled = false
 
bool windLocalWeatherAreaEnabled = false
 
bool visibilityBehaviorEnabled = false
 
std::map< std::string,
std::string > 
visibilityBehaviorParams
 
bool visibilityLocalWeatherAreaEnabled = false
 
double weatherAudibleAltitudeMeters = 8000.0
 
double weatherAltitudeFadeWidthMeters = 2000.0
 

Member Data Documentation

std::string makVrv::DtProceduralSoundscapeChannel::name

Caller-defined identifier, e.g. "ocean", "river", "forest". Used as the key for removeAmbientChannel().

Referenced by makVrv::serialize().

std::string makVrv::DtProceduralSoundscapeChannel::soundFile

Prefixed reference to the source of this channel's audio. Two forms are supported (raw file paths are no longer accepted):

Referenced by makVrv::serialize().

std::string makVrv::DtProceduralSoundscapeChannel::featureLayerName

Name of the osgEarth FeatureSource layer to query, e.g. "data:osm-water". If the layer is not found or not open, this channel is silent.

Referenced by makVrv::serialize().

std::vector<DtAttributeFilter> makVrv::DtProceduralSoundscapeChannel::attributeFilters

Zero or more attribute conditions that must ALL match for a feature to be considered (AND logic). Leave empty to match all features in the layer. Example: { {"waterway","river"}, {"tidal","yes"} }.

Referenced by makVrv::serialize().

std::vector<DtElevationCondition> makVrv::DtProceduralSoundscapeChannel::elevationConditions

Zero or more elevation conditions that must ALL hold (AND logic). The terrain elevation at the observer's WGS84 position is sampled from the map's ElevationPool and tested before the feature proximity query. Leave empty to skip the elevation check. Example (below sea level only): { {DtElevationCondition::Op::Less, 0.0} }.

Referenced by makVrv::serialize().

boost::optional<DtRasterSource> makVrv::DtProceduralSoundscapeChannel::rasterSource

Optional raster image layer used as a spatial trigger. Evaluated after elevation conditions and before the feature proximity query. Leave unset to skip raster sampling entirely.

See Also
DtRasterSource for mode details.

Referenced by makVrv::serialize().

float makVrv::DtProceduralSoundscapeChannel::densityScale = 1.0f

Runtime density multiplier applied on top of each DtProceduralSoundLayer's own density. Only meaningful for procedural soundscape channels (soundFile = "ProceduralSound:<key>"). 1.0 = normal density; 0.0 = silent; 2.0 = twice as many events per second. Ignored for regular looping-file channels.

Note
Has no effect on looping-file (WAV/OGG) channels. Multiplies each DtProceduralSoundLayer's own density at runtime - it does not override it.
double makVrv::DtProceduralSoundscapeChannel::fadeDistanceMeters = 500.0

Distance in meters over which the sound fades in/out as the observer approaches or leaves the boundary of a matching polygon. A value of 0 gives a hard binary on/off at the polygon boundary.

double makVrv::DtProceduralSoundscapeChannel::queryRadiusMeters = 5000.0

Radius in meters around the observer's position used to build the spatial bounds query sent to the FeatureSource. Larger values fetch more tiles and are more accurate but more expensive.

Note
Set to 0 to skip the FeatureSource spatial query entirely (e.g. for raster-source-only channels or channels that should always be active).
std::string makVrv::DtProceduralSoundscapeChannel::behaviorKey

Optional behavior key registered with DtProceduralSoundBehaviorFactory.

When non-empty, the behavior factory creates both the sound and the behavior for this channel. The soundFile field is derived automatically as kProceduralSoundPrefix + behaviorKey and must not be set manually when behaviorKey is non-empty.

Empty string = built-in defaults (data-driven or plain procedural sound).

bool makVrv::DtProceduralSoundscapeChannel::featureProximityEnabled = false

When false, featureLayerName/rasterSource are retained but the proximity gate always passes (gain = 1.0). Useful for Rain/Wind channels that play everywhere but can optionally be proximity-gated.

bool makVrv::DtProceduralSoundscapeChannel::precipitationBehaviorEnabled = false

When true, the Rain behavior is attached to this channel. soundFile is set automatically to kProceduralSoundPrefix + "Rain" at runtime.

std::map<std::string, std::string> makVrv::DtProceduralSoundscapeChannel::precipitationBehaviorParams

Key/value params forwarded to DtRainSoundBehaviorCreator::create(). Empty map -> DtRainSoundConfig::makeDefault() is used. Keys: "crossfadeWidthMmhr", "onsetRampMmhr", "tierN.source", "tierN.peakFrom", "tierN.peakTo".

bool makVrv::DtProceduralSoundscapeChannel::windBehaviorEnabled = false

When true, the Wind behavior is attached to this channel.

std::map<std::string, std::string> makVrv::DtProceduralSoundscapeChannel::windBehaviorParams

Key/value params forwarded to DtWindSoundBehaviorCreator::create(). Empty map -> DtWindSoundConfig::makeDefault() is used. Keys: "crossfadeWidthMs", "onsetRampMs", "tierN.source", "tierN.peakFrom", "tierN.peakTo".

bool makVrv::DtProceduralSoundscapeChannel::modelSet3dModelsEnabled = true

When true, this channel plays when the 3D Models model set is active. Defaults to true so existing channels are unaffected.

bool makVrv::DtProceduralSoundscapeChannel::modelSet3dColorizedEnabled = true

When true, this channel plays when the 3D Colorized model set is active. Defaults to true so existing channels are unaffected.

bool makVrv::DtProceduralSoundscapeChannel::modelSet2dIconsEnabled = true

When true, this channel plays when the 2D Icons model set is active. Defaults to true so existing channels are unaffected.

bool makVrv::DtProceduralSoundscapeChannel::precipitationLocalWeatherAreaEnabled = false

When true, the Rain behavior reads precipitation type and intensity from the nearest DtWeatherAreaObject at the observer's position instead of the global DtEnvironment. The local area's built-in 30 m edge fade governs the blend. Has no effect when precipitationBehaviorEnabled is false.

bool makVrv::DtProceduralSoundscapeChannel::windLocalWeatherAreaEnabled = false

When true, the Wind behavior reads wind speed from the nearest DtWeatherAreaObject at the observer's position instead of the global DtEnvironment. The local area's built-in 100 m edge fade governs the blend. Has no effect when windBehaviorEnabled is false.

bool makVrv::DtProceduralSoundscapeChannel::visibilityBehaviorEnabled = false

When true, the Visibility behavior is attached to this channel. soundFile is set automatically to kProceduralSoundPrefix + "Visibility" at runtime.

std::map<std::string, std::string> makVrv::DtProceduralSoundscapeChannel::visibilityBehaviorParams

Key/value params forwarded to DtVisibilitySoundBehaviorCreator::create(). Empty map -> DtVisibilitySoundConfig::makeDefault() is used. Keys: "clearVisibilityMeters", "onsetRampMeters", "crossfadeWidthMeters", "tierN.source", "tierN.peakFrom", "tierN.peakTo".

bool makVrv::DtProceduralSoundscapeChannel::visibilityLocalWeatherAreaEnabled = false

When true, the Visibility behavior reads visibility from the nearest DtWeatherAreaObject at the observer's position instead of the global DtEnvironment. The local area's built-in 100 m edge fade governs the blend. Has no effect when visibilityBehaviorEnabled is false.

double makVrv::DtProceduralSoundscapeChannel::weatherAudibleAltitudeMeters = 8000.0

Observer height-above-terrain (m) at which weather-driven channels start fading out.

Weather-driven channels (featureProximityEnabled == false, used by Rain / Wind / Visibility) play at full gain when the observer is below this ceiling, then fade linearly to silence over the next weatherAltitudeFadeWidthMeters. Feature-proximity channels (Forest / River / Ocean) ignore this field; they use the fadeDistanceMeters field for their audible-range fade instead.

Default 8000 m covers general aviation (props / helicopters / low bizjets) and puts commercial cruise altitudes (10-12 km) in the fully-silenced zone. Increase for high-altitude fixed-wing scenarios; decrease if a specific weather effect should only carry at lower altitudes.

double makVrv::DtProceduralSoundscapeChannel::weatherAltitudeFadeWidthMeters = 2000.0

Fade-zone width (m) above weatherAudibleAltitudeMeters over which the weather-channel volume tapers to silence.

Only meaningful when featureProximityEnabled is false. A value of 0 produces a hard cut at the ceiling; positive values give a linear -60 dB (dBFS) taper distributed across the width. Default 2000 m gives a smooth 2 km taper – e.g. with the default 8000 m ceiling, sound is fully silent by ~10 km above terrain (HAT).


The documentation for this struct was generated from the following file:

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)