createLensFlareStage

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, 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.

Return

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

See also