# DynamicEnvironmentMapManager

#### new Cesium.DynamicEnvironmentMapManager(options)
engine/Source/Scene/DynamicEnvironmentMapManager.js 69

Generates an environment map at the given position based on scene's current lighting conditions. From this, it produces multiple levels of specular maps and spherical harmonic coefficients than can be used with `ImageBasedLighting` for models or tilesets.

Name | Type | Description
--- | --- | ---
`options` | DynamicEnvironmentMapManager.ConstructorOptions | optional An object describing initialization options.

##### Examples:

    // Enable time-of-day environment mapping in a scene
    scene.atmosphere.dynamicLighting = Cesium.DynamicAtmosphereLightingType.SUNLIGHT;

    // Decrease the directional lighting contribution
    scene.light.intensity = 0.5

    // Increase the intensity of of the environment map lighting contribution
    const environmentMapManager = tileset.environmentMapManager;
    environmentMapManager.atmosphereScatteringIntensity = 3.0;

    // Change the ground color used for a model's environment map to a forest green
    const environmentMapManager = model.environmentMapManager;
    environmentMapManager.groundColor = Cesium.Color.fromCssColorString("#203b34");

### Members

#### static readonly Cesium.DynamicEnvironmentMapManager.AVERAGE_EARTH_GROUND_COLOR : Color
engine/Source/Scene/DynamicEnvironmentMapManager.js 1010

Average hue of ground color on earth, a warm green-gray.

#### static readonly Cesium.DynamicEnvironmentMapManager.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS : Array.<Cartesian3>
engine/Source/Scene/DynamicEnvironmentMapManager.js 1024

The default third order spherical harmonic coefficients used for the diffuse color of image-based lighting, a white ambient light with low intensity.

There are nine `Cartesian3` coefficients. The order of the coefficients is: L0,0, L1,-1, L1,0, L1,1, L2,-2, L2,-1, L2,0, L2,1, L2,2

##### See:

- An Efficient Representation for Irradiance Environment Maps

#### atmosphereScatteringIntensity : number
engine/Source/Scene/DynamicEnvironmentMapManager.js 161

The intensity of the scattered light emitted from the atmosphere. This should be adjusted relative to the value of `Scene.light` intensity.

Default Value: `2.0`

##### See:

- DirectionalLight.intensity
- SunLight.intensity

#### brightness : number
engine/Source/Scene/DynamicEnvironmentMapManager.js 177

The brightness of light emitted from the environment. 1.0 uses the unmodified emitted environment color. Less than 1.0 makes the light darker while greater than 1.0 makes it brighter.

Default Value: `1.0`

#### enabled : boolean
engine/Source/Scene/DynamicEnvironmentMapManager.js 131

If true, the environment map and related properties will continue to update.

Default Value: `true`

#### gamma : number
engine/Source/Scene/DynamicEnvironmentMapManager.js 169

The gamma correction to apply to the range of light emitted from the environment. 1.0 uses the unmodified incoming light color.

Default Value: `1.0`

#### groundAlbedo : number
engine/Source/Scene/DynamicEnvironmentMapManager.js 201

The percentage of light reflected from the ground. The average earth albedo is 0.31.

Default Value: `0.31`

#### groundColor : Color
engine/Source/Scene/DynamicEnvironmentMapManager.js 192

Solid color used to represent the ground.

Default Value: `DynamicEnvironmentMapManager.AVERAGE_EARTH_GROUND_COLOR`

#### maximumPositionEpsilon : number
engine/Source/Scene/DynamicEnvironmentMapManager.js 152

The maximum difference in position before a new environment map is created, in meters. Small differences in position will not visibly affect results.

Default Value: `1000`

#### maximumSecondsDifference : number
engine/Source/Scene/DynamicEnvironmentMapManager.js 145

The maximum amount of elapsed seconds before a new environment map is created.

Default Value: `3600`

#### position : Cartesian3|undefined
engine/Source/Scene/DynamicEnvironmentMapManager.js 236

The position around which the environment map is generated.

#### saturation : number
engine/Source/Scene/DynamicEnvironmentMapManager.js 185

The saturation of the light emitted from the environment. 1.0 uses the unmodified emitted environment color. Less than 1.0 reduces the saturation while greater than 1.0 increases it.

Default Value: `1.0`

### Methods

#### static Cesium.DynamicEnvironmentMapManager.isDynamicUpdateSupported(scene) → boolean
engine/Source/Scene/DynamicEnvironmentMapManager.js 1000

Returns `true` if dynamic updates are supported in the current WebGL rendering context. Dynamic updates requires the EXT_color_buffer_float or EXT_color_buffer_half_float extension.

Name | Type | Description
--- | --- | ---
`scene` | Scene | The object containing the rendering context

##### Returns:

true if supported

#### destroy()
engine/Source/Scene/DynamicEnvironmentMapManager.js 944

Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object.
Once an object is destroyed, it should not be used; calling any function other than `isDestroyed` will result in a `DeveloperError` exception. Therefore, assign the return value (`undefined`) to the object as done in the example.

##### Throws:

- DeveloperError : This object was destroyed, i.e., destroy() was called.

##### Example:

    mapManager = mapManager && mapManager.destroy();

##### See:

- DynamicEnvironmentMapManager#isDestroyed

#### isDestroyed() → boolean
engine/Source/Scene/DynamicEnvironmentMapManager.js 928

Returns true if this object was destroyed; otherwise, false.
If this object was destroyed, it should not be used; calling any function other than `isDestroyed` will result in a `DeveloperError` exception.

##### Returns:

`true` if this object was destroyed; otherwise, `false`.

##### See:

- DynamicEnvironmentMapManager#destroy

### Type Definitions

#### Cesium.DynamicEnvironmentMapManager.ConstructorOptions
engine/Source/Scene/DynamicEnvironmentMapManager.js 32

Options for the DynamicEnvironmentMapManager constructor

##### Properties:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`enabled` | boolean | <optional> | true | If true, the environment map and related properties will continue to update.
`mipmapLevels` | number | <optional> | 7 | The maximum desired number of mipmap levels to generate for specular maps. More mipmap levels will produce a higher resolution specular reflection. The actual number of mipmaps used will be bounded by the cubemap texture size supported on the client machine. The number of mipmaps must be at least one for the environment map to be generated.
`maximumSecondsDifference` | number | <optional> | 3600 | The maximum amount of elapsed seconds before a new environment map is created.
`maximumPositionEpsilon` | number | <optional> | 1000 | The maximum difference in position before a new environment map is created, in meters. Small differences in position will not visibly affect results.
`atmosphereScatteringIntensity` | number | <optional> | 2.0 | The intensity of the scattered light emitted from the atmosphere. This should be adjusted relative to the value of `Scene.light` intensity.
`gamma` | number | <optional> | 1.0 | The gamma correction to apply to the range of light emitted from the environment. 1.0 uses the unmodified emitted light color.
`brightness` | number | <optional> | 1.0 | The brightness of light emitted from the environment. 1.0 uses the unmodified emitted environment color. Less than 1.0 makes the light darker while greater than 1.0 makes it brighter.
`saturation` | number | <optional> | 1.0 | The saturation of the light emitted from the environment. 1.0 uses the unmodified emitted environment color. Less than 1.0 reduces the saturation while greater than 1.0 increases it.
`groundColor` | Color | <optional> | DynamicEnvironmentMapManager.AVERAGE_EARTH_GROUND_COLOR | Solid color used to represent the ground.
`groundAlbedo` | number | <optional> | 0.31 | The percentage of light reflected from the ground. The average earth albedo is 0.31.

Need help? The fastest way to get answers is from the community and team on the Cesium Forum.