class

VolumeManager

Per-frame volume evaluator.

Module
Volumes
Header
#include "Volumes/VolumeManager.h"
Namespace
Mowo

VolumeManager owns no state of its own — it walks the world's VolumeComponent entities each call and computes a blended VolumeProfile using the camera's world position. The result is materialized into a ScenePostProcess (the renderer's existing input contract) so the existing rendering path picks up the blended values with no further changes.

Algorithm (per Evaluate call): 1. Seed the result profile from the scene's baseline ScenePostProcess (all slots marked overriding → backwards compat when no volumes exist). 2. Collect every enabled VolumeComponent + its TransformComponent. 3. Compute per-volume weight in [0,1]: - global → weight = component.weight - local → distanceToBox / blendDistance fade, multiplied by weight 4. Sort by ascending priority (lower first), so higher-priority volumes overwrite earlier slot values. 5. For each (volume, weight) pair, walk the profile's slots and merge: - bool/int/enum: snap to source when overrides && weight ≥ 0.5 - float / Vec3 : lerp current → source by weight 6. Materialize the blended profile into out.

Designed to run unconditionally each frame — when no volumes exist the cost is one ScenePostProcess copy and the world's component iterator returning empty, both negligible.

Public functions

ReturnsNameDescription
voidEvaluateWalk the world, compute the blended profile at cameraPos, and write the result into outPostProcess.
VolumeProfileEvaluateProfileLower-level — produces the blended VolumeProfile without writing back to a ScenePostProcess.
voidBlendMerge one profile's overriding slots into another at weight, with the per-type rules above.
voidSetPreviewProfileEditor preview.
voidClearPreviewProfile
boolHasPreviewProfile

Function details

Evaluate

C++
static void Evaluate(World& world, const Vec3& cameraPos, const ScenePostProcess& seedDefaults, ScenePostProcess& outPostProcess)

Walk the world, compute the blended profile at cameraPos, and write the result into outPostProcess. seedDefaults is the scene's baseline (Scene::Environment().postProcess) used as the seed so the path is backwards-compatible.

EvaluateProfile

C++
static VolumeProfile EvaluateProfile(World& world, const Vec3& cameraPos, const VolumeProfile& seed)

Lower-level — produces the blended VolumeProfile without writing back to a ScenePostProcess. Useful for tooling and tests.

Blend

C++
static void Blend(VolumeProfile& dst, const VolumeProfile& src, float weight)

Merge one profile's overriding slots into another at weight, with the per-type rules above. Public because the Volume Profile editor shows what a given blend weight resolves to, and a preview computed by a second copy of these rules is a preview of something the renderer never produces.

SetPreviewProfile

C++
static void SetPreviewProfile(const VolumeProfile& profile)

Editor preview. While a profile is set it blends LAST at full weight, above every authored volume, so an open .volume document is what the viewport shows without the author first having to place a volume around the camera. Only the editor sets this.

ClearPreviewProfile

C++
static void ClearPreviewProfile()

HasPreviewProfile

C++
static bool HasPreviewProfile()
Generated from Volumes/VolumeManager.h via volumes.json · Oct 26, 2026Version 1.0.0