PostProcessStageComposite

new Cesium.PostProcessStageComposite(options)

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

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

Name Type Description
options object 对象,具有以下属性:
Name Type Default Description
stages Array 要按顺序执行的 PostProcessStage 或复合数组。
inputPreviousStageTexture boolean true optional 是否执行每个后处理阶段,其中一个阶段的输入是前一个阶段的输出。否则,每个包含的阶段的输入是在合成之前执行的阶段的输出。
name string createGuid() optional 此后处理阶段的唯一名称,供其他合成引用。如果未提供名称,将生成 GUID。
uniforms object optional 后处理阶段的 uniform 的别名。
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
const 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,则合成中每个阶段的输入纹理都相同。输入纹理是场景渲染到的纹理 或上一阶段的输出纹理。
此合成中的后处理阶段数。
此后处理阶段的唯一名称,供 PostProcessStageComposite 中的其他阶段引用。
确定此后处理阶段是否已准备好执行。
为应用后处理而选择的特征。
后处理阶段的 uniform 值的别名。可能是未定义的;在这种情况下,请获取每个阶段以设置 uniform 值。

Methods

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

一旦对象被销毁,就不应该使用它;调用 isDestroyed 将导致 DeveloperError 异常。 因此 将返回值 (undefined) 分配给对象,如示例中所示。

Throws:
See:
获取索引处的后处理阶段
Name Type Description
index number 后处理阶段或复合的索引。
Returns:
索引处的后处理阶段或合成。
Throws:
如果此对象已销毁,则返回 true;否则为 false。

如果此对象已销毁,则不应使用;调用 isDestroyed 将导致 DeveloperError 异常。

Returns:
如果此对象被销毁,则为 true;否则为 false
See:
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.