PolylineColorAppearance

new Cesium.PolylineColorAppearance(options)

具有颜色属性和 PolylineGeometryGroundPolylineGeometry。 这允许多个几何体实例(每个实例具有不同的颜色)来 与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 fragment shader source来覆盖默认片段着色器。
renderState Object optional 可选渲染状态以覆盖默认渲染状态。
Example:
// A solid white line segment
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

static constant Cesium.PolylineColorAppearance.VERTEX_FORMAT : VertexFormat

VertexFormat所有PolylineColorAppearance实例 与兼容。这只需要position属性。

readonly closed : Boolean

true时,几何体应该这样闭合 PolylineColorAppearance#renderState已启用背面消隐。 对于PolylineColorAppearance,总是false
Default Value: false

readonly fragmentShaderSource : String

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

readonly renderState : Object

WebGL修复了渲染几何体时要使用的函数状态。

The render state can be explicitly defined when constructing a PolylineColorAppearance instance, or it is set implicitly via PolylineColorAppearance#translucent.

translucent : Boolean

true时,几何体看起来是半透明的 PolylineColorAppearance#renderState启用了alpha混合。
Default Value: true
此外观实例与VertexFormat兼容。 一个几何体可以有更多的顶点属性并且仍然是兼容的 潜在的性能成本-但它不能少。
Default Value: PolylineColorAppearance.VERTEX_FORMAT

readonly vertexShaderSource : String

顶点着色器的GLSL源代码。

Methods

getFragmentShaderSource()String

按程序创建完整的GLSL片段着色器源。
Returns:
完整的GLSL片段着色器源。

getRenderState()Object

创建渲染状态。这不是最终渲染状态实例;而是, 它可以包含与渲染状态相同的渲染状态属性子集 在上下文中创建。
Returns:
渲染状态。

isTranslucent()Boolean

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