PostProcessStageLibrary

PostProcessStageLibrary()

Contains functions for creating common post-process stages.

Methods

staticCesium.PostProcessStageLibrary.createBlackAndWhiteStage()PostProcessStage

Creates a post-process stage that renders the input texture with black and white gradations.

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

Returns:
A post-process stage that renders the input texture with black and white gradations.

staticCesium.PostProcessStageLibrary.createBlurStage()PostProcessStageComposite

Creates a post-process stage that applies a Gaussian blur to the input texture. This stage is usually applied in conjunction with another stage.

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:
A post-process stage that applies a Gaussian blur to the input texture.

staticCesium.PostProcessStageLibrary.createBrightnessStage()PostProcessStage

Creates a post-process stage that saturates the input texture.

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

Returns:
A post-process stage that saturates the input texture.

staticCesium.PostProcessStageLibrary.createDepthOfFieldStage()PostProcessStageComposite

Creates a post-process stage that applies a depth of field effect.

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:
A post-process stage that applies a depth of field effect.

staticCesium.PostProcessStageLibrary.createLensFlarStage()PostProcessStage

Creates a post-process stage that applies an effect simulating light flaring a camera lens.

This stage has the following uniforms: dirtTexture, starTexture, intensity, distortion, ghostDispersal, haloWidth, 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.
  • ghostDispesal 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.
  • earthRadius is the maximum radius of the earth. The default value is Ellipsoid.WGS84.maximumRadius.

Returns:
A post-process stage for applying a lens flare effect.

staticCesium.PostProcessStageLibrary.createNightVisionStage()PostProcessStage

Creates a post-process stage that adds a night vision effect to the input texture.
Returns:
A post-process stage that adds a night vision effect to the input texture.

staticCesium.PostProcessStageLibrary.createSilhouetteStage()PostProcessStageComposite

Creates a post-process stage that applies a silhouette effect.

A silhouette effect highlights the edges of an object.

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.
Returns:
A post-process stage that applies a silhouette effect.