一组
PostProcessStage 或其他后处理组合阶段的集合,它们在逻辑上一起执行。
所有阶段按数组顺序执行。输入纹理会根据 inputPreviousStageTexture 的值而变化。
如果 inputPreviousStageTexture 为 true,则每个阶段的输入是场景渲染到的输出纹理,或在其之前执行的阶段的输出纹理。
如果 inputPreviousStageTexture 为 false,则组合中每个阶段的输入纹理相同。输入纹理是场景渲染到的纹理,
或是上一阶段的输出纹理。
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
An object with the following properties:
|
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。
