PostProcessStageLibrary

包含用于创建公共后处理阶段的函数。

Methods

static Cesium.PostProcessStageLibrary.createBlackAndWhiteStage()PostProcessStage

创建后处理阶段,该阶段使用黑白渐变渲染输入纹理。

This stage has one uniform value, gradations, which scales the luminance of each pixel.

Returns:
使用黑白渐变渲染输入纹理的后处理阶段。

static Cesium.PostProcessStageLibrary.createBlurStage()PostProcessStageComposite

创建将高斯模糊应用于输入纹理的后处理阶段。此阶段通常与另一阶段结合使用。

This stage has the following uniforms: delta, sigma, and stepSize.

delta and sigma are used to compute the weights of a Gaussian filter. The equation is exp((-0.5 * delta * delta) / (sigma * sigma)). The default value for delta is 1.0. The default value for sigma is 2.0. stepSize is the distance to the next texel. The default is 1.0.

Returns:
对输入纹理应用高斯模糊的后处理阶段。

static Cesium.PostProcessStageLibrary.createBrightnessStage()PostProcessStage

创建使输入纹理饱和的后处理阶段。

This stage has one uniform value, brightness, which scales the saturation of each pixel.

Returns:
饱和输入纹理的后处理阶段。

static Cesium.PostProcessStageLibrary.createDepthOfFieldStage()PostProcessStageComposite

创建应用景深效果的后处理阶段。

Depth of field simulates camera focus. Objects in the scene that are in focus will be clear whereas objects not in focus will be blurred.

This stage has the following uniforms: focalDistance, delta, sigma, and stepSize.

focalDistance is the distance in meters from the camera to set the camera focus.

delta, sigma, and stepSize are the same properties as PostProcessStageLibrary#createBlurStage. The blur is applied to the areas out of focus.

Returns:
应用景深效应的后处理阶段。

static Cesium.PostProcessStageLibrary.createEdgeDetectionStage()PostProcessStageComposite

创建检测边缘的后处理阶段。

Writes the color to the output texture with alpha set to 1.0 when it is on an edge.

This stage has the following uniforms: color and length

  • color is the color of the highlighted edge. The default is Color#BLACK.
  • length is the length of the edges in pixels. The default is 0.5.

This stage is not supported in 2D.

Returns:
应用边缘检测效果的后处理阶段。
Example:
// multiple silhouette effects
var yellowEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage();
yellowEdge.uniforms.color = Cesium.Color.YELLOW;
yellowEdge.selected = [feature0];

var greenEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage();
greenEdge.uniforms.color = Cesium.Color.LIME;
greenEdge.selected = [feature1];

// draw edges around feature0 and feature1
postProcessStages.add(Cesium.PostProcessLibrary.createSilhouetteStage([yellowEdge, greenEdge]);

static Cesium.PostProcessStageLibrary.createLensFlareStage()PostProcessStage

创建一个后处理阶段,该阶段应用模拟灯光照射摄影机镜头的效果。

This stage has the following uniforms: dirtTexture, starTexture, intensity, distortion, ghostDispersal, haloWidth, dirtAmount, and earthRadius.

  • dirtTexture is a texture sampled to simulate dirt on the lens.
  • starTexture is the texture sampled for the star pattern of the flare.
  • intensity is a scalar multiplied by the result of the lens flare. The default value is 2.0.
  • distortion is a scalar value that affects the chromatic effect distortion. The default value is 10.0.
  • ghostDispersal is a scalar indicating how far the halo effect is from the center of the texture. The default value is 0.4.
  • haloWidth is a scalar representing the width of the halo from the ghost dispersal. The default value is 0.4.
  • dirtAmount is a scalar representing the amount of dirt on the lens. The default value is 0.4.
  • earthRadius is the maximum radius of the earth. The default value is Ellipsoid.WGS84.maximumRadius.
Returns:
用于应用镜头光斑效果的后处理阶段。

static Cesium.PostProcessStageLibrary.createNightVisionStage()PostProcessStage

创建后处理阶段,将夜视效果添加到输入纹理。
Returns:
为输入纹理添加夜视效果的后处理阶段。

static Cesium.PostProcessStageLibrary.createSilhouetteStage(edgeDetectionStages)PostProcessStageComposite

创建应用剪影效果的后处理阶段。

A silhouette effect composites the color from the edge detection pass with input color texture.

This stage has the following uniforms when edgeDetectionStages is undefined: color and length

color is the color of the highlighted edge. The default is Color#BLACK. length is the length of the edges in pixels. The default is 0.5.

Name Type Description
edgeDetectionStages Array.<PostProcessStage> optional 一个边缘检测后处理阶段的数组。
Returns:
应用剪影效果的后处理阶段。

static Cesium.PostProcessStageLibrary.isAmbientOcclusionSupported(scene)Boolean

是否支持环境光遮挡阶段。

This stage requires the WEBGL_depth_texture extension.

Name Type Description
scene Scene 现场。
Returns:
是否支持此后处理阶段。
See:

static Cesium.PostProcessStageLibrary.isDepthOfFieldSupported(scene)Boolean

是否支持景深阶段。

This stage requires the WEBGL_depth_texture extension.

Name Type Description
scene Scene 现场。
Returns:
是否支持此后处理阶段。
See:

static Cesium.PostProcessStageLibrary.isEdgeDetectionSupported(scene)Boolean

是否支持边缘检测级。

This stage requires the WEBGL_depth_texture extension.

Name Type Description
scene Scene 现场。
Returns:
是否支持此后处理阶段。
See:

static Cesium.PostProcessStageLibrary.isSilhouetteSupported(scene)Boolean

是否支持剪影阶段。

This stage requires the WEBGL_depth_texture extension.

Name Type Description
scene Scene 现场。
Returns:
是否支持此后处理阶段。
See: