![]() |
VR-Forces Developer's Guide
|
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.
| 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):
"ProceduralSound:<key>" - registered with DtProceduralSoundFactory::addSoundCreator(). Use the constant makVrv::kProceduralSoundPrefix when constructing this token."ModelDefinition:<entryName>" - a Sound-schema DtModelDefinition entry. The entry may specify either procedural_sound_name (dispatched through the ProceduralSound branch) or sound_filepath + sound_decibels (installed as a looping voice).
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.
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.
| 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.
| 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).