一组
PostProcessStage 或其他后处理复合阶段,逻辑上一起执行。
所有阶段按照数组的顺序执行。输入纹理基于 inputPreviousStageTexture 的值而变化。
如果 inputPreviousStageTexture 为 true,则每个阶段的输入是由场景渲染的纹理或之前执行的阶段的输出纹理。
如果 inputPreviousStageTexture 为 false,则复合中每个阶段的输入纹理都是相同的。输入纹理是由场景渲染的纹理
或前一个阶段的输出纹理。
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
包含以下属性的对象:
|
Throws:
-
DeveloperError : options.stages.length 必须大于 0.0。
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
是否在准备好时执行此后处理阶段。
所有后处理阶段按照数组的顺序执行。输入纹理基于
inputPreviousStageTexture 的值而变化。
如果 inputPreviousStageTexture 为 true,则每个阶段的输入是由场景渲染的纹理或之前执行的阶段的输出纹理。
如果 inputPreviousStageTexture 为 false,则复合中每个阶段的输入纹理都是相同的。输入纹理是由场景渲染的纹理
或前一个阶段的输出纹理。
该复合中后处理阶段的数量。
此后处理阶段的唯一名称,以便其他阶段在 PostProcessStageComposite 中引用。
确定此后处理阶段是否准备好执行。
应用后处理的特征选择。
后处理阶段 uniform 值的别名。可以是
undefined;在这种情况下,获取每个阶段以设置 uniform 值。
Methods
销毁此对象持有的 WebGL 资源。销毁对象允许确定性地释放
WebGL 资源,而不是依赖于垃圾收集器销毁此对象。
一旦对象被销毁,就不应使用;调用除 isDestroyed 之外的任何功能将导致 DeveloperError 异常。因此,
将返回值 (undefined) 赋给对象,如示例中所示。
Throws:
-
DeveloperError : 此对象已被销毁,即调用了 destroy()。
get(index) → PostProcessStage|PostProcessStageComposite
获取在
index 的后处理阶段。
| Name | Type | Description |
|---|---|---|
index |
number | 后处理阶段或复合的索引。 |
Returns:
指定索引的后处理阶段或复合。
Throws:
-
DeveloperError : index 必须大于或等于 0。
-
DeveloperError : index 必须小于
PostProcessStageComposite#length。
如果此对象已被销毁,则返回 true;否则返回 false。
如果此对象已被销毁,则不应使用;调用除 isDestroyed 之外的任何功能将导致 DeveloperError 异常。
Returns:
如果此对象已被销毁,则返回
true;否则返回 false。
