Skip to content

KBE3D / KBCore / Cesium / DynamicEnvironmentMapManager

类: DynamicEnvironmentMapManager

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.

Examples

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

参数

An object describing initialization options.

属性

AVERAGE_EARTH_GROUND_COLOR

readonly static AVERAGE_EARTH_GROUND_COLOR: Color

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


DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS

readonly static DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS: Cartesian3[]

The default third order spherical harmonic coefficients used for the diffuse color of image-based lighting, a white ambient light with low intensity. <p> There are nine <code>Cartesian3</code> coefficients. The order of the coefficients is: L<sub>0,0</sub>, L<sub>1,-1</sub>, L<sub>1,0</sub>, L<sub>1,1</sub>, L<sub>2,-2</sub>, L<sub>2,-1</sub>, L<sub>2,0</sub>, L<sub>2,1</sub>, L<sub>2,2</sub> </p>


enabled

enabled: boolean

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


maximumSecondsDifference

maximumSecondsDifference: number

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


maximumPositionEpsilon

maximumPositionEpsilon: number

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


atmosphereScatteringIntensity

atmosphereScatteringIntensity: number

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


gamma

gamma: number

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


brightness

brightness: number

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

saturation: number

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

groundColor: Color

Solid color used to represent the ground.


groundAlbedo

groundAlbedo: number

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


position

position: Cartesian3 | undefined

The position around which the environment map is generated.

方法

isDynamicUpdateSupported()

static isDynamicUpdateSupported(scene: Scene): boolean

Returns <code>true</code> 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.

参数

scene

Scene

The object containing the rendering context

返回

boolean

true if supported


isDestroyed()

isDestroyed(): boolean

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

返回

boolean

true if this object was destroyed; otherwise, false.


destroy()

destroy(): void

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. <br /><br /> Once an object is destroyed, it should not be used; calling any function other than <code>isDestroyed</code> will result in a DeveloperError exception. Therefore, assign the return value (<code>undefined</code>) to the object as done in the example.

返回

void

示例

ts
mapManager = mapManager && mapManager.destroy();

构造函数

构造函数

new DynamicEnvironmentMapManager(options?: ConstructorOptions): DynamicEnvironmentMapManager

参数

options?

ConstructorOptions

返回

DynamicEnvironmentMapManager

KBE3D @3.0.0 Copyright © 2024-present KBE3D