EllipsoidSurfaceAppearance

new Cesium.EllipsoidSurfaceAppearance(options)

椭球表面的几何图形外观,如PolygonGeometryRectangleGeometry, 它支持MaterialAppearanceMaterialAppearance.MaterialSupport.ALL等所有材质。 这种外观需要较少的顶点属性,因为片段着色器可以计算normal, tangent, 和 bitangent
Name Type Description
options Object optional 具有下列属性的对象:
Name Type Default Description
flat Boolean false optionaltrue时,在片段着色器中使用了平面着色,这意味着没有考虑到光照。
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片段着色器源,用于覆盖默认的片段着色器。
renderState RenderState 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

staticconstantCesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT : VertexFormat

所有EllipsoidSurfaceAppearance实例都兼容的VertexFormat,它只需要position and st属性。 其他属性是在片段着色器中计算的。

readonlyaboveGround : Boolean

true时,几何图形应该在椭球表面—而不是在椭球表面之上的恒定高度— 因此EllipsoidSurfaceAppearance#renderState启用了背面剔除。
Default Value: false

readonlyclosed : Boolean

如果为 trueEllipsoidSurfaceAppearance#renderState 开启背面剔除。
Default Value: false

readonlyfaceForward : Boolean

true时,片段着色器会根据需要翻转表面法线, 以确保法线面对观察者,避免出现黑斑。当几何图形的两侧都应像WallGeometry 一样着色时,这很有用。
Default Value: true
true时,在片段着色器中使用了平面着色,这意味着没有考虑到光照。
Default Value: false

readonlyfragmentShaderSource : String

片段着色器的GLSL源代码。 完整的片段着色器源程序是根据EllipsoidSurfaceAppearance#materialEllipsoidSurfaceAppearance#flatEllipsoidSurfaceAppearance#faceForward构建的。 使用EllipsoidSurfaceAppearance#getFragmentShaderSource获得完整的源代码。
用于确定片元颜色的材质。与其他EllipsoidSurfaceAppearance属性不同,它不是只读的,所以外观的材质可以动态改变。
Default Value: Material.ColorType
See:

readonlyrenderState : Object

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

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

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

readonlyvertexShaderSource : String

顶点着色器的GLSL源代码。

Methods

getFragmentShaderSource()String

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

getRenderState()Object

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

isTranslucent()Boolean

根据Appearance#translucentMaterial#isTranslucent}确定几何图形是否为半透明。
Returns:
如果外观为半透明,返回true。