EllipsoidSurfaceAppearance

new Cesium.EllipsoidSurfaceAppearance(options)

PolygonGeometry这样的椭球表面上的几何图形 以及RectangleGeometry,它支持MaterialAppearance等所有材质 MaterialAppearance.MaterialSupport.ALL。但是,这种外观要求 由于碎片着色器可以按程序计算normal,因此顶点属性更少, tangentbitangent
Name Type Description
options Object optional 具有以下属性的对象:
Name Type Default Description
flat Boolean false optional 在6666中,不考虑阴影,这意味着不考虑碎片。
faceForward Boolean options.aboveGround optionaltrue时,碎片着色器根据需要翻转曲面法线,以确保法线面向查看器以避免出现黑点。当几何体的两侧都应着色时,这很有用,如WallGeometry
translucent Boolean true optionaltrue时,几何体看起来是半透明的,因此EllipsoidSurfaceAppearance#renderState启用了alpha混合。
aboveGround Boolean false optionaltrue时,几何体应该在椭球体的表面上-而不是在它上面的固定高度-所以EllipsoidSurfaceAppearance#renderState启用了背面消隐。
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.PolygonGeometry({
      vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
      // ...
    })
  }),
  appearance : new Cesium.EllipsoidSurfaceAppearance({
    material : Cesium.Material.fromType('Stripe')
  })
});
See:

Members

static constant Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT : VertexFormat

所有的st中的VertexFormat 与兼容,这只需要position和st 属性。其他属性在片段着色器中按程序计算。

readonly aboveGround : Boolean

true时,几何体应该在椭球体上 表面-不是在其上方的固定高度-所以EllipsoidSurfaceAppearance#renderState 已启用背面消隐。
Default Value: false

readonly closed : Boolean

true时,几何体应该这样闭合 EllipsoidSurfaceAppearance#renderState已启用背面消隐。 如果查看器进入几何体,它将不可见。
Default Value: false

readonly faceForward : Boolean

true时,碎片着色器翻转曲面法线 如有必要,确保观察者避开法线 暗点。当几何体的两侧都应该 阴影像WallGeometry
Default Value: true

readonly flat : Boolean

true时,在片段着色器中使用平面着色, 这意味着照明不考虑在内。
Default Value: false

readonly fragmentShaderSource : String

片段着色器的GLSL源代码。完整片段着色器 按照程序构建源时考虑到EllipsoidSurfaceAppearance#materialEllipsoidSurfaceAppearance#flatEllipsoidSurfaceAppearance#faceForward。 使用EllipsoidSurfaceAppearance#getFragmentShaderSource获取完整源代码。
用来确定碎片颜色的材料。不像其他的EllipsoidSurfaceAppearance 属性,这不是只读的,因此外观的材质可以动态更改。
Default Value: Material.ColorType
See:

readonly renderState : Object

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

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

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

readonly vertexShaderSource : String

顶点着色器的GLSL源代码。

Methods

getFragmentShaderSource()String

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

getRenderState()Object

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

isTranslucent()Boolean

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