PostProcessStage
或其他逻辑上一起执行的后处理复合阶段的集合。
所有阶段都按数组的顺序执行。输入纹理根据 inputPreviousStageTexture
的值而变化。
如果 inputPreviousStageTexture
为 true
,则每个阶段的输入是场景或之前执行的阶段渲染的输出纹理。
如果 inputPreviousStageTexture
为 false
,则合成中每个阶段的输入纹理都相同。输入纹理是场景渲染到的纹理
或上一阶段的输出纹理。
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
对象,具有以下属性:
|
Throws:
-
DeveloperError : options.stages.length must be greater than 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 值的别名。可能是
未定义的
;在这种情况下,请获取每个阶段以设置 uniform 值。
Methods
销毁此对象持有的 WebGL 资源。 销毁对象允许确定性
释放 WebGL 资源,而不是依赖垃圾回收器来销毁这个对象。
一旦对象被销毁,就不应该使用它;调用
isDestroyed
将导致 DeveloperError
异常。 因此
将返回值 (undefined
) 分配给对象,如示例中所示。
Throws:
-
DeveloperError : 这个物体被摧毁了,destroy().
get(index) → PostProcessStage|PostProcessStageComposite
获取
索引
处的后处理阶段
Name | Type | Description |
---|---|---|
index |
number | 后处理阶段或复合的索引。 |
Returns:
索引处的后处理阶段或合成。
Throws:
-
DeveloperError : 索引必须大于或等于 0。
如果此对象已销毁,则返回 true;否则为 false。
如果此对象已销毁,则不应使用;调用
isDestroyed
将导致 DeveloperError
异常。
Returns:
如果此对象被销毁,
则为 true
;否则为 false
。