Table of Contents

Interface IAmbientManager

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll

This is the system that manages the worlds ambient settings, such as fog color/density and clouds. The ambient manager basically blends ambientmodifiers on top of each other to generate the final ambient values. Blending is in order how the modifiers are held in CurrentModifiers in the likes of float weight = modifier.FogMin.Weight; BlendedFogMin = w * modifier.FogMin.Value + (1 - w) * BlendedFogMin;

public interface IAmbientManager
Extension Methods

Properties

Base

The base value or background ambient to overlay everything onto

AmbientModifier Base { get; }

Property Value

AmbientModifier

BlendedAmbientColor

The blended ambient color, calculated every frame from the list of modifiers

Vec3f BlendedAmbientColor { get; }

Property Value

Vec3f

BlendedCloudBrightness

The blended cloud brightness, calculated every frame from the list of modifiers

float BlendedCloudBrightness { get; }

Property Value

float

BlendedCloudDensity

The blended cloud density, calculated every frame from the list of modifiers

float BlendedCloudDensity { get; }

Property Value

float

BlendedFlatFogDensity

The blended flat fog density, calculated every frame from the list of modifiers

float BlendedFlatFogDensity { get; set; }

Property Value

float

BlendedFlatFogYOffset

The blended flat fog y-offset, calculated every frame from the list of modifiers

float BlendedFlatFogYOffset { get; set; }

Property Value

float

BlendedFlatFogYPosForShader

BlendedFlatFogYPos + SeaLevel - MainCamera.TargetPosition.Y

float BlendedFlatFogYPosForShader { get; set; }

Property Value

float

BlendedFogBrightness

float BlendedFogBrightness { get; }

Property Value

float

BlendedFogColor

The blended fog color, calculated every frame from the list of modifiers

Vec4f BlendedFogColor { get; }

Property Value

Vec4f

BlendedFogDensity

The blended fog density, calculated every frame from the list of modifiers

float BlendedFogDensity { get; }

Property Value

float

BlendedFogMin

The blended fog min, calculated every frame from the list of modifiers

float BlendedFogMin { get; }

Property Value

float

BlendedSceneBrightness

float BlendedSceneBrightness { get; }

Property Value

float

CurrentModifiers

The list of modifiers that result in the blended values

OrderedDictionary<string, AmbientModifier> CurrentModifiers { get; }

Property Value

OrderedDictionary<string, AmbientModifier>

Methods

UpdateAmbient(float)

The update loop for this manager. Runs every frame.

void UpdateAmbient(float dt)

Parameters

dt float

the Delta or change in Time