PolylineColorAppearance

new Cesium.PolylineColorAppearance(options)

带有颜色属性和PolylineGeometryGroundPolylineGeometryGeometryInstance实例的外观。 这允许使用相同的Primitive绘制几个几何实例,每个实例使用不同的颜色。
Name Type Description
options Object optional 具有下列属性的对象:
Name Type Default Description
translucent Boolean true optionaltrue时,几何图形应该是半透明的,因此PolylineColorAppearance#renderState启用了alpha混合。
vertexShaderSource String optional 可选的GLSL顶点着色器源覆盖默认的顶点着色器。
fragmentShaderSource String optional 可选的GLSL片段着色器源覆盖默认的片段着色器。
renderState RenderState optional 可选的渲染状态来覆盖默认的渲染状态。
Example:
// 一条白色的线段
var primitive = new Cesium.Primitive({
  geometryInstances : new Cesium.GeometryInstance({
    geometry : new Cesium.PolylineGeometry({
      positions : Cesium.Cartesian3.fromDegreesArray([
        0.0, 0.0,
        5.0, 0.0
      ]),
      width : 10.0,
      vertexFormat : Cesium.PolylineColorAppearance.VERTEX_FORMAT
    }),
    attributes : {
      color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0))
    }
  }),
  appearance : new Cesium.PolylineColorAppearance({
    translucent : false
  })
});

Members

staticconstantCesium.PolylineColorAppearance.VERTEX_FORMAT : VertexFormat

所有PolylineColorAppearance实例都兼容的VertexFormat。 这只需要一个position属性。

readonlyclosed : Boolean

true时,几何图形将被关闭,因此PolylineColorAppearance#renderState启用了背面剔除。
Default Value: false

readonlyfragmentShaderSource : String

片段着色器的GLSL源代码。
此属性是Appearance接口的一部分,但PolylineColorAppearance不使用此属性,因为使用的是完全自定义的片段着色器。
Default Value: undefined

readonlyrenderState : Object

渲染几何图形时的WEBGL状态。

渲染状态可以在构造一个 PolylineColorAppearance例时显式定义, 也可以通过PolylineColorAppearance#translucent隐式设置。

translucent : Boolean

true时,几何图形应该是半透明的,因此PolylineColorAppearance#renderState启用了alpha混合。
Default Value: true
与此外观实例兼容的VertexFormat。 几何图形可以有更多的顶点属性,而且仍然是兼容的——以潜在的性能成本为代价——但它不能有更少的顶点属性。
Default Value: PolylineColorAppearance.VERTEX_FORMAT

readonlyvertexShaderSource : String

顶点着色器的GLSL源代码。

Methods

getFragmentShaderSource()String

创建完整的GLSL片段着色源。
Returns:
完整的GLSL片段着色源。

getRenderState()Object

创建渲染状态。
Returns:
渲染状态。

isTranslucent()Boolean

基于PolylineColorAppearance#translucent确定几何图形是否为半透明。
Returns:
true如果外观是半透明的。