function DynamicEnvironmentMapManager(options) {
  this._position = undefined;

  this._radianceMapDirty = false;
  this._radianceCommandsDirty = false;
  this._convolutionsCommandsDirty = false;
  this._irradianceCommandDirty = false;
  this._irradianceTextureDirty = false;
  this._sphericalHarmonicCoefficientsDirty = false;

  this._shouldRegenerateShaders = false;
  this._shouldReset = false;

  options = options ?? Frozen.EMPTY_OBJECT;

  const mipmapLevels = Math.min(
    options.mipmapLevels ?? 7,
    Math.log2(ContextLimits.maximumCubeMapSize),
  );

  this._mipmapLevels = mipmapLevels;
  this._radianceMapComputeCommands = new Array(6);
  this._convolutionComputeCommands = new Array((mipmapLevels - 1) * 6);
  this._irradianceComputeCommand = undefined;

  this._radianceMapFS = undefined;
  this._irradianceMapFS = undefined;
  this._convolveSP = undefined;
  this._va = undefined;

  this._radianceMapTextures = new Array(6);
  this._specularMapTextures = new Array((mipmapLevels - 1) * 6);
  this._radianceCubeMap = undefined;
  this._irradianceMapTexture = undefined;

  this._sphericalHarmonicCoefficients =
    DynamicEnvironmentMapManager.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice();

  this._lastTime = new JulianDate();
  const width = Math.pow(2, mipmapLevels - 1);
  this._textureDimensions = new Cartesian2(width, width);

  this._radiiAndDynamicAtmosphereColor = new Cartesian3();
  this._sceneEnvironmentMap = undefined;
  this._backgroundColor = undefined;

  // If this DynamicEnvironmentMapManager has an owner, only its owner should update or destroy it.
  // This is because in a Cesium3DTileset multiple models may reference one tileset's DynamicEnvironmentMapManager.
  this._owner = undefined;

  /**
   * If true, the environment map and related properties will continue to update.
   * @type {boolean}
   * @default true
   */
  this.enabled = options.enabled ?? true;

  /**
   * Disables updates. For internal use.
   * @private
   * @default true
   */
  this.shouldUpdate = true;

  /**
   * The maximum amount of elapsed seconds before a new environment map is created.
   * @type {number}
   * @default 3600
   */
  this.maximumSecondsDifference = options.maximumSecondsDifference ?? 60 * 60;

  /**
   * The maximum difference in position before a new environment map is created, in meters. Small differences in position will not visibly affect results.
   * @type {number}
   * @default 1000
   */
  this.maximumPositionEpsilon = options.maximumPositionEpsilon ?? 1000.0;

  /**
   * The intensity of the scattered light emitted from the atmosphere. This should be adjusted relative to the value of {@link Scene.light} intensity.
   * @type {number}
   * @default 2.0
   * @see DirectionalLight.intensity
   * @see SunLight.intensity
   */
  this.atmosphereScatteringIntensity =
    options.atmosphereScatteringIntensity ?? 2.0;

  /**
   * The gamma correction to apply to the range of light emitted from the environment. 1.0 uses the unmodified incoming light color.
   * @type {number}
   * @default 1.0
   */
  this.gamma = options.gamma ?? 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.
   * @type {number}
   * @default 1.0
   */
  this.brightness = options.brightness ?? 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.
   * @type {number}
   * @default 1.0
   */
  this.saturation = options.saturation ?? 1.0;

  /**
   * Solid color used to represent the ground.
   * @type {Color}
   * @default DynamicEnvironmentMapManager.AVERAGE_EARTH_GROUND_COLOR
   */
  this.groundColor =
    options.groundColor ??
    DynamicEnvironmentMapManager.AVERAGE_EARTH_GROUND_COLOR;

  /**
   * The percentage of light reflected from the ground. The average earth albedo is 0.31.
   * @type {number}
   * @default 0.31
   */
  this.groundAlbedo = options.groundAlbedo ?? 0.31;
}
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 {@link ImageBasedLighting} for models or tilesets.
@alias DynamicEnvironmentMapManager
@constructor
@param {DynamicEnvironmentMapManager.ConstructorOptions} [options] An object describing initialization options.

@example
// 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;

@example
// 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");