new PostProcessStageCollection()
The collection of PostProcessStage and/or PostProcessStageComposite.
The input texture for each post-processing stage is either the texture rendered by the scene or the texture rendered by the previous stage in the set.
If ambient occlusion or blooming stages are enabled, they will be executed before all other stages.
If the FXAA stage is enabled, it will execute after all other stages.
Members
-
readonly ambientOcclusionPostProcessStageComposite
-
Apply horizon based ambient occlusion (HBAO) to the post-processing stage of input textures.
Environmental occlusion simulates shadows from ambient light. When the surface receives light, these shadows will always exist regardless of the position of the light.
Uniforms have the following properties intensity, bias, lengthCap, stepSize, frustumLength, ambientOcclusionOnly, delta, sigma, and blurStepSize.
- intensity is a scalar value used to exponentially brighten or darken shadows. Higher values make shadows darker. Default is 3.0.
- bias is a scalar value representing an angle in radians. If the dot product between the sample's normal and the camera's direction vector is less than this value, sampling stops in the current direction. This is used to remove shadows near the edge of a plane. Default is 0.1.
- lengthCap is a scalar value representing length in meters. If the distance from the current sample to the first sample exceeds this value, sampling stops along the current direction. Default is 0.26.
- stepSize is a scalar value indicating the distance to the next texel sample in the current direction. Default is 1.95.
- frustumLength is a scalar value in meters. If the distance from the current fragment to the camera exceeds this value, ambient occlusion will not be computed for that fragment. Default is 1000.0.
- ambientOcclusionOnly is a boolean. When true, only the generated shadow is written to the output. When false, the input texture is modulated with ambient occlusion. This is a useful debugging option for seeing the effect of changing uniform values. Default is false.
delta, sigma, The properties of BlurStepSize and PostProcessStageLibrary # creatBlurStage are the same. Blur is applied to shadows generated from images to make them smoother.
After activation, this stage will be executed before all other stages.
-
readonly bloomPostProcessStageComposite
-
The post-processing stage of blooming effect.
The blooming effect enhances the luminous effect, making bright areas brighter and dark areas darker.
This stage has the following uniforms: contrast, brightness, glowOnly, delta, sigma, and stepSize
- contrast is a scalar value in the range [-255.0, 255.0] that affects the contraction of the effect. Default is 128.0.
- brightness is a scalar value. The input texture RGB values are converted to hue, saturation, and brightness (HSB), and this value is added to the brightness. Default is -0.3.
- glowOnly is a boolean. When true, only the glow effect is displayed. When false, the glow is added to the input texture. Default is false. This is a debugging option for seeing the effect when changing other uniform values.
delta, sigma, The properties of stepSize and PostProcessStageLibrary # creatBlurStage are the same. Blur is applied to shadows generated from images to make them smoother.
After activation, this stage will be executed before all other stages.
-
fogObject
-
Obtain fog effect.
-
readonly fxaaPostProcessStage
-
Quickly approximate the post-processing stage of anti aliasing.
After activation, this stage will be executed after all other stages.
-
readonly lengthNumber
-
The number of post-processing stages in this collection.
-
lightShaftBoolean
-
Obtain the beam flood effect, which can simulate the Tyndall effect of light.
- Default Value: false
Example
scene.postProcessStages.lightShaft.enabled = true;
outlineProperty
Retrieve the specified contour properties.
- Default Value: false
rainPostProcessStage
Obtain the rain effect.
readonly readyBoolean
Determine if all post-processing stages in the set are ready to execute.
readonly smaaPostProcessStage
Whether to enable anti aliasing function.
snowPostProcessStage
Obtain snow effect.
readonly taaTemporalAntiAliasing
时序反走样 (TAA) 后处理。
Methods
-
add(stage){PostProcessStage|PostProcessStageComposite}
-
Add post-processing stages to the collection.
Name Type Description stagePostProcessStage | PostProcessStageComposite Add to the post-processing stage of the collection.
Throws:
-
The post-processing stage has been added to the collection or does not have a unique name.
- Type
- DeveloperError
Returns:
Type Description PostProcessStage | PostProcessStageComposite The post-processing stage added to the collection. -
-
contains(stage){Boolean}
-
Return whether the collection contains post-processing stages.
Name Type Description stagePostProcessStage | PostProcessStageComposite Post processing stage.
Returns:
Type Description Boolean Does the collection include post-processing stages. -
destroy()
-
Destroy the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, rather than relying on a garbage collector to destroy the object.
Once an object is destroyed, it should not be used; Calling any function other than isDestroyed will result in a Developer Error exception. Therefore, as done in the example, assign the return value (undefined) to the object.
Throws:
-
The object was destroyed by calling destroy().
- Type
- DeveloperError
-
-
get(index){PostProcessStage|PostProcessStageComposite}
-
Obtain the post-processing stage at the index.
Name Type Description indexNumber Index of post-processing stage.
Returns:
Type Description PostProcessStage | PostProcessStageComposite The post-processing stage of indexing. -
isDestroyed(){Boolean}
-
If this object is destroyed, return true; Otherwise, it is false
If the object is destroyed, it should not be used; Calling any function other than isDestroyed will result in a Developer Error exception.
Returns:
Type Description Boolean If this object is destroyed, it is true; Otherwise, false -
remove(stage){Boolean}
-
Remove the post-processing stage from the collection and destroy it.
Name Type Description stagePostProcessStage | PostProcessStageComposite The post-processing stage to be removed from the collection.
Returns:
Type Description Boolean Has the post-processing phase been removed. -
removeAll()
-
Remove all post-processing stages from the collection and destroy them.