PolylineMaterialAppearance

new Cesium.PolylineMaterialAppearance(options)

PolylineGeometry的外观,支持材质着色。
Name Type Description
options Object optional 具有以下属性的对象:
Name Type Default Description
translucent Boolean true optionaltrue时,几何体看起来是半透明的,因此PolylineMaterialAppearance#renderState启用了alpha混合。
material Material Material.ColorType optional 用来确定碎片颜色的材料。
vertexShaderSource String optional 可选的GLSL顶点着色器源来覆盖默认顶点着色器。
fragmentShaderSource String optional 可选的GLSL fragment shader source来覆盖默认片段着色器。
renderState Object 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.PolylineMaterialAppearance.VERTEX_FORMAT
    })
  }),
  appearance : new Cesium.PolylineMaterialAppearance({
    material : Cesium.Material.fromType('Color')
  })
});
See:

Members

static constant Cesium.PolylineMaterialAppearance.VERTEX_FORMAT : VertexFormat

所有的st中的VertexFormat 与兼容。这需要position和st属性。

readonly closed : Boolean

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

readonly fragmentShaderSource : String

片段着色器的GLSL源代码。
用来确定碎片颜色的材料。不像其他的PolylineMaterialAppearance 属性,这不是只读的,因此外观的材质可以动态更改。
Default Value: Material.ColorType
See:

readonly renderState : Object

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

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

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

readonly vertexShaderSource : String

顶点着色器的GLSL源代码。

Methods

getFragmentShaderSource()String

按程序创建完整的GLSL片段着色器源。对于PolylineMaterialAppearance, 它来自PolylineMaterialAppearance#fragmentShaderSourcePolylineMaterialAppearance#material
Returns:
完整的GLSL片段着色器源。

getRenderState()Object

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

isTranslucent()Boolean

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