根据场景当前的光照条件,在给定位置生成环境贴图。由此生成多个级别的高光贴图和球面谐波系数,这些可以与
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
从大气中散射的光的强度。应根据
Scene.light 的强度值进行调整。
-
Default Value:
- DirectionalLight.intensity
- SunLight.intensity
2.0
See:
环境中发出的光的亮度。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
groundColor : Color
用于表示地面的固体颜色。
-
Default Value:
DynamicEnvironmentMapManager.AVERAGE_EARTH_GROUND_COLOR
创建新的环境贴图之前,位置的最大差异(以米为单位)。小位置差异不会明显影响结果。
-
Default Value:
1000
创建新的环境贴图之前允许经过的最大秒数。
-
Default Value:
3600
position : Cartesian3|undefined
环境贴图生成的中心位置。
环境中发出的光的饱和度。1.0 使用未经修改的环境颜色。小于 1.0 会降低
饱和度,而大于 1.0 会增加饱和度。
-
Default Value:
1.0
Methods
如果在当前 WebGL 渲染上下文中支持动态更新,则返回
true。
动态更新需要 EXT_color_buffer_float 或 EXT_color_buffer_half_float 扩展。
| Name | Type | Description |
|---|---|---|
scene |
Scene | 包含渲染上下文的对象 |
Returns:
如果支持则返回 true
销毁此对象持有的 WebGL 资源。销毁一个对象允许确定性地释放 WebGL 资源,而不是依赖垃圾收集器来销毁此对象。
一旦对象被销毁,就不应该再使用;调用除
一旦对象被销毁,就不应该再使用;调用除
isDestroyed 以外的任何函数将导致 DeveloperError 异常。因此,
将返回值 (undefined) 赋给对象,如示例中所示。
Throws:
-
DeveloperError : 此对象已被销毁,即已调用 destroy()。
Example:
mapManager = mapManager && mapManager.destroy();
See:
Returns:
true 如果这个对象已被销毁;否则返回 false。
Type Definitions
DynamicEnvironmentMapManager 构造函数的选项
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
enabled |
boolean |
<optional> |
true | 如果为 true,环境贴图和相关属性将继续更新。 |
mipmapLevels |
number |
<optional> |
10 | 为高光贴图生成的 mipmap 级别数。更多的 mipmap 级别将产生更高分辨率的高光反射。 |
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。 |
