Skip to content

KBE3D / KBCore / Cesium / createElevationBandMaterial

函数: createElevationBandMaterial()

createElevationBandMaterial(options: { scene: Scene; layers: createElevationBandMaterialBand[]; }): Material

Creates a Material that combines multiple layers of color/gradient bands and maps them to terrain heights.

The shader does a binary search over all the heights to find out which colors are above and below a given height, and interpolates between them for the final color. This material supports hundreds of entries relatively cheaply.

参数

options

Object with the following properties:

scene

Scene

The scene where the visualization is taking place.

layers

createElevationBandMaterialBand[]

A list of bands ordered from lowest to highest precedence.

返回

Material

A new Material instance.

示例

ts
scene.globe.material = Cesium.createElevationBandMaterial({
    scene : scene,
    layers : [{
        entries : [{
            height : 4200.0,
            color : new Cesium.Color(0.0, 0.0, 0.0, 1.0)
        }, {
            height : 8848.0,
            color : new Cesium.Color(1.0, 1.0, 1.0, 1.0)
        }],
        extendDownwards : true,
        extendUpwards : true,
    }, {
        entries : [{
            height : 7000.0,
            color : new Cesium.Color(1.0, 0.0, 0.0, 0.5)
        }, {
            height : 7100.0,
            color : new Cesium.Color(1.0, 0.0, 0.0, 0.5)
        }]
    }]
});

KBE3D @3.0.0 Copyright © 2024-present KBE3D