DynamicEnvironmentMapManager

new Cesium.DynamicEnvironmentMapManager(options)

根据给定的位置基于场景当前的光照条件生成环境贴图。由此产生多个级别的镜面反射贴图和球谐系数,可配合 ImageBasedLighting 用于模型或瓦片集。
Name Type Description
options DynamicEnvironmentMapManager.ConstructorOptions optional 描述初始化选项的对象。
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

地球上地面颜色的平均色调,一种温暖的绿灰色。

static readonly Cesium.DynamicEnvironmentMapManager.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS : Array.<Cartesian3>

用于基于图像光照漫反射颜色的默认三阶球谐系数,是一种低强度白色环境光。

共有九个 Cartesian3 系数。 系数的顺序为:L0,0, L1,-1, L1,0, L1,1, L2,-2, L2,-1, L2,0, L2,1, L2,2

See:

atmosphereScatteringIntensity : number

从大气发射的散射光强度。应根据 Scene.light 强度的值进行调整。
Default Value: 2.0
See:
  • DirectionalLight.intensity
  • SunLight.intensity
从环境发射的光的亮度。1.0 使用未修改的发射环境颜色。小于 1.0 会使光线变暗,而大于 1.0 会使光线变亮。
Default Value: 1.0
如果为 true,环境贴图及相关属性将继续更新。
Default Value: true
应用于从环境发射的光范围的伽马校正。1.0 使用未修改的发射光颜色。
Default Value: 1.0
从地面反射的光的百分比。地球平均反照率为 0.31。
Default Value: 0.31
用于表示地面的纯色。
Default Value: DynamicEnvironmentMapManager.AVERAGE_EARTH_GROUND_COLOR
创建新环境贴图前位置的最大差异(以米为单位)。位置的微小差异不会对结果产生明显影响。
Default Value: 1000
创建新环境贴图前经过的最大秒数。
Default Value: 3600
生成环境贴图所围绕的位置。
从环境发射的光的饱和度。1.0 使用未修改的发射环境颜色。小于 1.0 降低饱和度,而大于 1.0 提高饱和度。
Default Value: 1.0

Methods

static Cesium.DynamicEnvironmentMapManager.isDynamicUpdateSupported(scene)boolean

如果当前 WebGL 渲染上下文支持动态更新则返回 true。 动态更新需要 EXT_color_buffer_float 或 EXT_color_buffer_half_float 扩展。
Name Type Description
scene Scene 包含渲染上下文的对象
Returns:
如果受支持则为 true
销毁此对象持有的 WebGL 资源。销毁对象可以实现 WebGL 资源的确定性 释放,而不是依赖垃圾回收器来销毁此对象。

一旦对象被销毁,就不应再使用它;调用除 isDestroyed 之外的任何函数都将导致 DeveloperError 异常。因此, 应像示例中那样将返回值(undefined)赋给该对象。
Throws:
Example:
mapManager = mapManager && mapManager.destroy();
See:
如果此对象已销毁则为 true,否则为 false。

此对象被销毁后不应再使用;调用除 isDestroyed 之外的任何函数都将导致 DeveloperError 异常。
Returns:
如果此对象已销毁则为 true,否则为 false
See:

Type Definitions

Cesium.DynamicEnvironmentMapManager.ConstructorOptions

DynamicEnvironmentMapManager 构造函数的选项
Properties:
Name Type Attributes Default Description
enabled boolean <optional>
true 如果为 true,环境贴图及相关属性将继续更新。
mipmapLevels number <optional>
7 为镜面反射贴图生成的最大期望 mipmap 级别数。更多的 mipmap 级别将产生更高分辨率的镜面反射。实际使用的 mipmap 数量受客户端机器支持的立方体贴图纹理大小限制。环境贴图要生成,mipmap 的数量必须至少为 1。
maximumSecondsDifference number <optional>
3600 创建新环境贴图前经过的最大秒数。
maximumPositionEpsilon number <optional>
1000 创建新环境贴图前位置的最大差异(以米为单位)。位置的微小差异不会对结果产生明显影响。
atmosphereScatteringIntensity number <optional>
2.0 从大气发射的散射光强度。应根据 Scene.light 强度的值进行调整。
gamma number <optional>
1.0 应用于从环境发射的光范围的伽马校正。1.0 使用未修改的发射光颜色。
brightness number <optional>
1.0 从环境发射的光的亮度。1.0 使用未修改的发射环境颜色。小于 1.0 会使光线变暗,而大于 1.0 会使光线变亮。
saturation number <optional>
1.0 从环境发射的光的饱和度。1.0 使用未修改的发射环境颜色。小于 1.0 降低饱和度,而大于 1.0 提高饱和度。
groundColor Color <optional>
DynamicEnvironmentMapManager.AVERAGE_EARTH_GROUND_COLOR 用于表示地面的纯色。
groundAlbedo number <optional>
0.31 从地面反射的光的百分比。地球平均反照率为 0.31。
需要帮助?获取答案的最快方式是在 Cesium 论坛 上向社区和团队提问。