一种用于椭球表面几何(如
PolygonGeometry
和 RectangleGeometry)的外观,它支持所有材质,如同 MaterialAppearance
配合 MaterialAppearance.MaterialSupport.ALL。不过,由于片元着色器可以按程序计算 normal、
tangent 和 bitangent,此外观所需的顶点属性更少。
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
optional
包含以下属性的对象:
|
Example:
const 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
当为
true 时,几何预期位于椭球
表面(而非在其上方固定高度处),因此 EllipsoidSurfaceAppearance#renderState
启用了背面剔除。
-
Default Value:
false
当为
true 时,几何预期为闭合的,因此
EllipsoidSurfaceAppearance#renderState 启用了背面剔除。
如果观察者进入几何体内部,它将不可见。
-
Default Value:
false
当为
true 时,片元着色器会按需翻转表面法线,
以确保法线朝向观察者,避免
出现暗斑。当几何体的两侧都需要着色(如 WallGeometry)时,这很有用。
-
Default Value:
true
当为
true 时,片元着色器使用平面着色,
即不考虑光照。
-
Default Value:
false
片元着色器的 GLSL 源码。完整的片元着色器
源码是按程序构建的,会考虑
EllipsoidSurfaceAppearance#material、
EllipsoidSurfaceAppearance#flat 和 EllipsoidSurfaceAppearance#faceForward。
使用 EllipsoidSurfaceAppearance#getFragmentShaderSource 获取完整源码。
用于确定片元颜色的材质。与其他
EllipsoidSurfaceAppearance
属性不同,它不是只读的,因此外观的材质可以动态更改。
-
Default Value:
Material.ColorType
See:
渲染几何时要使用的 WebGL 固定功能状态。
渲染状态可以在构造 EllipsoidSurfaceAppearance
实例时显式定义,也可以通过 EllipsoidSurfaceAppearance#translucent
和 EllipsoidSurfaceAppearance#aboveGround 隐式设置。
当为
true 时,几何预期为半透明。
-
Default Value:
true
readonly vertexFormat : VertexFormat
此外观实例兼容的
VertexFormat。
几何可以拥有更多的顶点属性并仍然兼容——但会有
潜在的性能开销——但它不能少于此格式。
-
Default Value:
EllipsoidSurfaceAppearance.VERTEX_FORMAT
顶点着色器的 GLSL 源码。
Methods
按程序创建完整的 GLSL 片元着色器源码。对于
EllipsoidSurfaceAppearance,
它派生自 EllipsoidSurfaceAppearance#fragmentShaderSource、EllipsoidSurfaceAppearance#flat
和 EllipsoidSurfaceAppearance#faceForward。
Returns:
完整的 GLSL 片元着色器源码。
创建一个渲染状态。这不是最终的渲染状态实例,而是
可以包含与上下文中创建的渲染状态
相同的部分渲染状态属性。
Returns:
渲染状态。
根据
EllipsoidSurfaceAppearance#translucent 和 Material#isTranslucent 判断几何是否半透明。
Returns:
如果外观是半透明的则为
true。
