根据场景当前的光照条件在给定位置生成环境贴图。由此,它产生多个级别的镜面反射贴图和球谐系数,可以与 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
地球上底色的平均色调,温暖的绿灰色。 Average hue of ground color on earth, a warm green-gray.
static readonly Cesium.DynamicEnvironmentMapManager.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS : Array.<Cartesian3>
默认的三阶球谐系数用于基于图像的照明的漫反射颜色,即低强度的白色环境光。 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 系数。系数的顺序为:L coefficients. The order of the coefficients is: L0,0,L , L1,-1,L , L1,0,L , L1,1,L , L2,-2,L , L2,-1,L , L2,0,L , L2,1,L , L2,2
从大气中发出的散射光的强度。这应该相对于值进行调整 The intensity of the scattered light emitted from the atmosphere. This should be adjusted relative to the value of
Scene.light intensity.
-
默认值: Default Value:
- DirectionalLight.intensity
- SunLight.intensity
2.0
另见: See:
从环境发出的光的亮度。 1.0 使用未修改的发射环境颜色。小于 1.0 会使光线变暗,而大于 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.
-
默认值: Default Value:
1.0
如果为 true,环境贴图和相关属性将继续更新。 If true, the environment map and related properties will continue to update.
-
默认值: Default Value:
true
适用于从环境发出的光范围的伽玛校正。 1.0 使用未修改的入射光颜色。 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
从地面反射的光的百分比。地球平均反照率是0.31。 The percentage of light reflected from the ground. The average earth albedo is 0.31.
-
默认值: Default Value:
0.31
groundColor : Color
纯色用于代表地面。 Solid color used to represent the ground.
-
默认值: Default Value:
DynamicEnvironmentMapManager.AVERAGE_EARTH_GROUND_COLOR
创建新环境贴图之前的最大位置差异(以米为单位)。位置上的微小差异不会明显影响结果。 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
创建新环境贴图之前经过的最大秒数。 The maximum amount of elapsed seconds before a new environment map is created.
-
默认值: Default Value:
3600
position : Cartesian3|undefined
生成环境贴图的位置。 The position around which the environment map is generated.
从环境发出的光的饱和度。 1.0 使用未修改的发射环境颜色。小于 1.0 会降低饱和度,而大于 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.
-
默认值: Default Value:
1.0
方法 Methods
Returns
true 当前 WebGL 渲染上下文是否支持动态更新。动态更新需要 EXT_color_buffer_float 或 EXT_color_buffer_half_float 扩展。 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 true if supported
销毁该对象持有的 WebGL 资源。销毁对象可以确定性地释放 WebGL 资源,而不是依赖垃圾收集器来销毁该对象。 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
一旦对象被销毁,就不应再使用;调用除 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:
如果该对象被销毁则返回 true;否则为假。 Returns true if this object was destroyed; otherwise, false.
如果该对象被破坏,则不应使用它;调用除 If this object was destroyed, it should not be used; calling any function other than
如果该对象被破坏,则不应使用它;调用除 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:
类型定义 Type Definitions
DynamicEnvironmentMapManager 构造函数的选项 Options for the DynamicEnvironmentMapManager constructor
属性: Properties:
| 名称 Name | 类型 Type | Attributes | 默认值 Default | 说明 Description |
|---|---|---|---|---|
enabled |
boolean |
<可选> <optional> |
true | 如果为 true,环境贴图和相关属性将继续更新。 If true, the environment map and related properties will continue to update. |
mipmapLevels |
number |
<可选> <optional> |
7 | 为镜面反射贴图生成的 mipmap 级别的最大所需数量。更多 mipmap 级别将产生更高分辨率的镜面反射。实际使用的 mipmap 数量将受到客户端计算机支持的立方体贴图纹理大小的限制。 mipmap 的数量必须至少为 1,才能生成环境贴图。 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 | 适用于从环境发出的光范围的伽玛校正。 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 | 从环境发出的光的亮度。 1.0 使用未修改的发射环境颜色。小于 1.0 会使光线变暗,而大于 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 | 从环境发出的光的饱和度。 1.0 使用未修改的发射环境颜色。小于 1.0 会降低饱和度,而大于 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 | 从地面反射的光的百分比。地球平均反照率是0.31。 The percentage of light reflected from the ground. The average earth albedo is 0.31. |
