PostProcessStageComposite

new Cesium.PostProcessStageComposite(options)

PostProcessStages或其它逻辑上一起执行的后处理复合阶段的集合。

All stages are executed in the order of the array. The input texture changes based on the value of inputPreviousStageTexture. If inputPreviousStageTexture is true, the input to each stage is the output texture rendered to by the scene or of the stage that executed before it. If inputPreviousStageTexture is false, the input texture is the same for each stage in the composite. The input texture is the texture rendered to by the scene or the output texture of the previous stage.

Name Type Description
options Object 具有以下属性的对象:
Name Type Default Description
stages Array 按顺序执行的PostProcessStages数组或复合数组。
inputPreviousStageTexture Boolean true optional 是否执行每个后处理阶段,其中一个阶段的输入是前一个阶段的输出。否则,每个包含阶段的输入是在复合之前执行的阶段的输出。
name String createGuid() optional 此后处理阶段的唯一名称,供其他复合材料参考。如果没有提供名称,将生成GUID。
uniforms Object optional 后处理阶段制服的别名。
Throws:
Examples:
// Example 1: separable blur filter
// The input to blurXDirection is the texture rendered to by the scene or the output of the previous stage.
// The input to blurYDirection is the texture rendered to by blurXDirection.
scene.postProcessStages.add(new Cesium.PostProcessStageComposite({
    stages : [blurXDirection, blurYDirection]
}));
// Example 2: referencing the output of another post-process stage
scene.postProcessStages.add(new Cesium.PostProcessStageComposite({
    inputPreviousStageTexture : false,
    stages : [
        // The same as Example 1.
        new Cesium.PostProcessStageComposite({
            inputPreviousStageTexture : true
            stages : [blurXDirection, blurYDirection],
            name : 'blur'
        }),
        // The input texture for this stage is the same input texture to blurXDirection since inputPreviousStageTexture is false
        new Cesium.PostProcessStage({
            fragmentShader : compositeShader,
            uniforms : {
                blurTexture : 'blur' // The output of the composite with name 'blur' (the texture that blurYDirection rendered to).
            }
        })
    ]
});
// Example 3: create a uniform alias
var uniforms = {};
Cesium.defineProperties(uniforms, {
    filterSize : {
        get : function() {
            return blurXDirection.uniforms.filterSize;
        },
        set : function(value) {
            blurXDirection.uniforms.filterSize = blurYDirection.uniforms.filterSize = value;
        }
    }
});
scene.postProcessStages.add(new Cesium.PostProcessStageComposite({
    stages : [blurXDirection, blurYDirection],
    uniforms : uniforms
}));
See:

Members

准备好后是否执行此后处理阶段。

readonly inputPreviousStageTexture : Boolean

所有后处理阶段都按数组的顺序执行。输入纹理基于值inputPreviousStageTexture而变化。 如果inputPreviousStageTexturetrue,则每个阶段的输入是由场景渲染的输出纹理或在其之前执行的阶段的输出纹理。 如果inputPreviousStageTexturefalse,则合成中每个阶段的输入纹理都相同。输入纹理是场景渲染到的纹理 或者上一级的输出纹理。

readonly length : Number

此组合中的后处理阶段数。
此后处理阶段的唯一名称,供PostProcessStageComposite中的其他阶段引用。

readonly ready : Boolean

确定此后处理阶段是否准备好执行。
为应用后期处理而选择的功能。
后处理阶段的统一值的别名。可能是undefined;在这种情况下,让每个阶段设置统一的值。

Methods

销毁此对象持有的WebGL资源。销毁一个对象允许确定性 释放WebGL资源,而不是依赖垃圾回收器销毁此对象。

Once an object is destroyed, it should not be used; calling any function other than isDestroyed will result in a DeveloperError exception. Therefore, assign the return value (undefined) to the object as done in the example.

Throws:
See:
获取index处的后处理阶段
Name Type Description
index Number 后处理阶段或组合的索引。
Returns:
后处理阶段或索引处的合成。
Throws:

isDestroyed()Boolean

如果此对象已销毁,则返回true;否则返回false。

If this object was destroyed, it should not be used; calling any function other than isDestroyed will result in a DeveloperError exception.

Returns:
如果此对象被销毁,则为true;否则为false
See: