内置方法
这一阶段有一个uniform值,gradations,衡量每个像素的亮度(luminance)。
该阶段有以下uniforms:delta,sigma和stepSize。
delta和sigma用来计算高斯过滤的权值。方程式为exp((-0.5 * delta * delta) / (sigma * sigma))。
delta >的默认值是1.0。sigma >的默认值是2.0。
stepSize是到下一个纹素的距离。默认值是1.0。
这一阶段有一个uniform值,brightness,衡量每个像素的饱和度。
景深模拟相机对焦。场景中聚焦的物体会很清晰,而非聚焦的物体会很模糊。
该阶段有以下uniforms:focalDistance,delta,sigma和stepSize。
focalDistance是从相机到设置相机焦点的距离(以米为单位)。
delta,sigma和stepSize与 PostProcessStageLibrary#createBlurStage 中的属性一致。
模糊应用于失焦的区域。
将颜色写入输出纹理,当位于边缘时将alpha设置为1.0。
该阶段有以下uniforms:color和length。
color是突出显示边缘的颜色。默认为Color#BLACK。length是边缘的长度,以像素为单位。默认为0.5。
2D中不支持此阶段。
// 多个剪影效果
var yellowEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage();
yellowEdge.uniforms.color = Cesium.Color.YELLOW;
yellowEdge.selected = [feature0];
var greenEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage();
greenEdge.uniforms.color = Cesium.Color.LIME;
greenEdge.selected = [feature1];
// 在feature0和feature1周围绘制边缘
postProcessStages.add(Cesium.PostProcessLibrary.createSilhouetteEffect([yellowEdge, greenEdge]);
这个阶段有以下uniforms:dirtTexture,starTexture,intensity,distortion,
ghostDispersal,haloWidth,dirtAmount和earthRadius。
dirtTexture是在镜头上模拟尘埃(dirt)的一个纹理采样。starTexture是为耀斑的星图(star pattern)采样的纹理。intensity是一个标量乘以镜头耀斑的结果。 默认值为2.0。distortion是影响彩色效果失真的标量值。默认值为10.0。ghostDispersal是一个标量,表示光晕效果距离纹理中心有多远。默认值为0.4。haloWidth是一个标量,表示从ghostDispersal而来的光晕的宽度。默认值为0.4。- code>dirtAmount是一个标量,表示镜头上的尘埃(dirt)量。默认值为
0.4。 earthRadius是地球的最大半径。默认值为Ellipsoid.WGS84.maximumRadius。
剪影效果从具有输入颜色纹理的边缘检测通道复合颜色。
当edgeDetectionStages为undefined时,该阶段有以下uniforms:color和length
color是突出显示边缘的颜色。默认为Color#BLACK。length是边缘的长度,以像素为单位。默认为0.5。该阶段需要WEBGL_depth_texture扩展。
| Name | Type | Description |
|---|---|---|
scene |
Scene | 场景。 |
该阶段需要WEBGL_depth_texture扩展。
| Name | Type | Description |
|---|---|---|
scene |
Scene | 场景。 |
该阶段需要WEBGL_depth_texture扩展。
| Name | Type | Description |
|---|---|---|
scene |
Scene | 场景。 |
该阶段需要WEBGL_depth_texture扩展。
| Name | Type | Description |
|---|---|---|
scene |
Scene | 场景。 |