为椭球体表面的几何体提供一种外观,例如
PolygonGeometry 和 RectangleGeometry,支持所有材质,如 MaterialAppearance
和 MaterialAppearance.MaterialSupport.ALL。然而,该外观所需的顶点属性更少,因为片段着色器可以程序性地计算 normal、tangent 和 bitangent。
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
optional
具有以下属性的对象:
|
Example:
const primitive = new Cesium.Primitive({
geometryInstances : new Cesium.GeometryInstance({
geometry : new Cesium.PolygonGeometry({
vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
// ...
})
}),
appearance : new Cesium.EllipsoidSurfaceAppearance({
material : Cesium.Material.fromType('Stripe')
})
});
See:
Members
static constant Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT : VertexFormat
当
true 时,几何体预期位于椭球体的
表面——而不是在其上方的恒定高度——所以 EllipsoidSurfaceAppearance#renderState
启用背面剔除。
-
Default Value:
false
当
true 时,几何图形应闭合,以便
EllipsoidSurfaceAppearance#renderState 启用背面剔除。
如果观察者进入几何体,它将不可见。
-
Default Value:
false
当
true 时,片段着色器根据需要翻转表面法线,
以确保法线面向观察者,避免
暗点。这在几何体的两侧都应着色时非常有用,
如 WallGeometry。
-
Default Value:
true
当
true 时,片段着色器使用平面阴影,
这意味着光照不被考虑。
-
Default Value:
false
片段着色器的 GLSL 源代码。完整的片段着色器
源代码是程序性构建的,考虑了
EllipsoidSurfaceAppearance#material、
EllipsoidSurfaceAppearance#flat 和 EllipsoidSurfaceAppearance#faceForward。
使用 EllipsoidSurfaceAppearance#getFragmentShaderSource 获取完整源代码。
用于确定片段颜色的材质。与其他
EllipsoidSurfaceAppearance
属性不同,这个属性不是只读的,因此外观的材质可以动态更改。
-
Default Value:
Material.ColorType
See:
渲染几何体时使用的 WebGL 固定功能状态。
渲染状态可以在构建 EllipsoidSurfaceAppearance
实例时显式定义,或通过 EllipsoidSurfaceAppearance#translucent
和 EllipsoidSurfaceAppearance#aboveGround 隐式设置。
当
true 时,几何体预期显示为半透明。
-
Default Value:
true
readonly vertexFormat : VertexFormat
此外观实例兼容的
VertexFormat。
几何体可以有更多的顶点属性,仍然兼容——
但可能会牺牲性能——但不能更少。
-
Default Value:
EllipsoidSurfaceAppearance.VERTEX_FORMAT
顶点着色器的 GLSL 源代码。
Methods
程序性地创建完整的 GLSL 片段着色器源代码。对于
EllipsoidSurfaceAppearance,
这来源于 EllipsoidSurfaceAppearance#fragmentShaderSource、EllipsoidSurfaceAppearance#flat
和 EllipsoidSurfaceAppearance#faceForward。
Returns:
完整的 GLSL 片段着色器源代码。
创建一个渲染状态。这不是最终的渲染状态实例;相反,
它可以包含与上下文中创建的渲染状态相同的部分渲染状态属性。
Returns:
渲染状态。
根据
EllipsoidSurfaceAppearance#translucent 和 Material#isTranslucent 判断几何体是否为半透明。
Returns:
true 如果外观是半透明的。
