PostProcessStage或其他逻辑上一起执行的后处理复合阶段。 s or other post-process composite stages that execute together logically.
所有阶段均按数组顺序执行。输入纹理根据值改变 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 |
具有以下属性的对象: An object with the following properties:
|
抛出: Throws:
-
DeveloperError :options.stages.length 必须大于 0.0。 : 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。如果 . 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.
undefined;在这种情况下,让每个阶段设置统一的值。 ; in which case, get each stage to set uniform values.
方法 Methods
一旦对象被销毁,就不应再使用;调用除 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:
-
DeveloperError : This object was destroyed, i.e., destroy() was called.
get(index) → PostProcessStage|PostProcessStageComposite
index
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
index |
number | 后处理阶段或复合的索引。 The index of the post-process stage or composite. |
返回: Returns:
抛出: Throws:
-
DeveloperError : index must be greater than or equal to 0.
-
DeveloperError : index must be less than
PostProcessStageComposite#length.
如果该对象被破坏,则不应使用它;调用除 If this object was destroyed, it should not be used; calling any function other than
isDestroyed 将导致 will result in a DeveloperError exception.
返回: Returns:
true 如果该物体被摧毁;否则, if this object was destroyed; otherwise, false.
