Methods
static Cesium.PostProcessStageLibrary.createBlackAndWhiteStage() → PostProcessStage
此阶段有一个 uniform 值 gradations,用来缩放每个像素的亮度。
Returns:
static Cesium.PostProcessStageLibrary.createBlurStage() → PostProcessStageComposite
此阶段具有以下 uniforms: delta、sigma 和 stepSize。
delta 和 sigma 用于计算高斯滤波器的权重。计算公式为 exp((-0.5 * delta * delta) / (sigma * sigma))。
delta 的默认值为 1.0。sigma 的默认值为 2.0。
stepSize 是到下一个纹理元素的距离。默认值为 1.0。
Returns:
static Cesium.PostProcessStageLibrary.createBrightnessStage() → PostProcessStage
此阶段有一个 uniform 值 brightness,用来缩放每个像素的饱和度。
Returns:
static Cesium.PostProcessStageLibrary.createDepthOfFieldStage() → PostProcessStageComposite
景深模拟相机对焦。场景中的对焦物体会清晰,而未对焦的物体会模糊。
此阶段具有以下 uniforms: focalDistance、delta、sigma 和 stepSize。
focalDistance 是从相机到设置相机对焦的距离(以米为单位)。
delta、sigma 和 stepSize 是与 PostProcessStageLibrary#createBlurStage 相同的属性。
模糊应用于未对焦的区域。
Returns:
static Cesium.PostProcessStageLibrary.createEdgeDetectionStage() → PostProcessStage
在边缘处,将颜色写入输出纹理,alpha 设置为 1.0。
此阶段具有以下 uniforms: color 和 length
color是高亮边缘的颜色。默认值为Color#BLACK。length是以像素为单位的边缘长度。默认值为0.5。
此阶段在 2D 模式下不支持。
Returns:
Example:
// multiple silhouette effects
const yellowEdge = Cesium.PostProcessStageLibrary.createEdgeDetectionStage();
yellowEdge.uniforms.color = Cesium.Color.YELLOW;
yellowEdge.selected = [feature0];
const greenEdge = Cesium.PostProcessStageLibrary.createEdgeDetectionStage();
greenEdge.uniforms.color = Cesium.Color.LIME;
greenEdge.selected = [feature1];
// draw edges around feature0 and feature1
postProcessStages.add(Cesium.PostProcessStageLibrary.createSilhouetteStage([yellowEdge, greenEdge]);
static Cesium.PostProcessStageLibrary.createLensFlareStage() → PostProcessStage
此阶段具有以下 uniforms: dirtTexture、starTexture、intensity、distortion、ghostDispersal、
haloWidth、dirtAmount 和 earthRadius。
dirtTexture是一个纹理,样本用于模拟镜头上的污垢。starTexture是用于光晕星形图案的纹理。intensity是一个标量,与镜头光晕的结果相乘。默认值为2.0。distortion是一个影响色差效果失真的标量值。默认值为10.0。ghostDispersal是一个标量,指示光晕效果距离纹理中心的距离。默认值为0.4。haloWidth是一个标量,表示从光晕扩散的宽度。默认值为0.4。dirtAmount是一个标量,表示镜头上的污垢量。默认值为0.4。earthRadius是地球的最大半径。默认值为Ellipsoid.WGS84.maximumRadius。
Returns:
static Cesium.PostProcessStageLibrary.createNightVisionStage() → PostProcessStage
Returns:
static Cesium.PostProcessStageLibrary.createSilhouetteStage(edgeDetectionStages) → PostProcessStageComposite
轮廓效果将边缘检测阶段的颜色与输入颜色纹理进行复合。
当 edgeDetectionStages 为 undefined 时,此阶段具有以下 uniforms: color 和 length。
color 是高亮边缘的颜色。默认值为 Color#BLACK。
length 是以像素为单位的边缘长度。默认值为 0.5。
| Name | Type | Description |
|---|---|---|
edgeDetectionStages |
Array.<PostProcessStage> | optional 一个边缘检测后处理阶段的数组。 |
Returns:
此阶段需要 WEBGL_depth_texture 扩展。
| Name | Type | Description |
|---|---|---|
scene |
Scene | 场景。 |
Returns:
此阶段需要 WEBGL_depth_texture 扩展。
| Name | Type | Description |
|---|---|---|
scene |
Scene | 场景。 |
Returns:
此阶段需要 WEBGL_depth_texture 扩展。
| Name | Type | Description |
|---|---|---|
scene |
Scene | 场景。 |
Returns:
此阶段需要 WEBGL_depth_texture 扩展。
| Name | Type | Description |
|---|---|---|
scene |
Scene | 场景。 |
