椭球体表面上的几何体外观,如
PolygonGeometry
和 RectangleGeometry
,它支持所有材质,如 MaterialAppearance
替换为 MaterialAppearance.MaterialSupport.ALL
。 但是,此外观需要
由于片段着色器可以程序化地计算法线
、
tangent
和 bitangent
的 API 请求。
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
,则几何体应位于椭球体的
surface - 不在其上方的恒定高度 - 因此 EllipsoidSurfaceAppearance#renderState
已启用背面剔除。
-
Default Value:
false
如果为
true
,则几何体应被关闭,因此
EllipsoidSurfaceAppearance#renderState
已启用背面剔除。
如果查看器进入几何图形,则几何图形将不可见。
-
Default Value:
false
如果为
true
,则片段着色器将翻转表面法线
根据需要确保法线面向观看者避免
黑斑。 当几何体的两侧都应该
像 WallGeometry
一样着色。
-
Default Value:
true
如果为
true
,则在片段着色器中使用平面着色。
表示未考虑照明。
-
Default Value:
false
片段着色器的 GLSL 源代码。 完整的片段着色器
source 是按照程序构建的,考虑了
EllipsoidSurfaceAppearance#material
,
EllipsoidSurfaceAppearance#flat
和 EllipsoidSurfaceAppearance#faceForward
。
使用 EllipsoidSurfaceAppearance#getFragmentShaderSource
获取完整源代码。
用于确定片段颜色的材料。 与其他
EllipsoidSurfaceAppearance
不同
属性,这不是只读的,因此外观的材质可以动态更改。
-
Default Value:
Material.ColorType
See:
渲染几何体时使用的 WebGL 固定函数状态。
在构造 EllipsoidSurfaceAppearance
时,可以显式定义渲染状态
实例,或者通过 EllipsoidSurfaceAppearance#translucent
隐式设置
和 EllipsoidSurfaceAppearance#aboveGround
的 SurfaceSurfaceAppearance 中。
如果为 true
,则几何体应显示为半透明。
-
Default Value:
true
readonly vertexFormat : VertexFormat
与此外观实例兼容的
VertexFormat
。
几何体可以具有更多顶点属性,并且仍然兼容 - 在
潜在的性能成本 - 但不能更少。
-
Default Value:
EllipsoidSurfaceAppearance.VERTEX_FORMAT
顶点着色器的 GLSL 源代码。
Methods
以程序方式创建完整的 GLSL 片段着色器源。 对于
EllipsoidSurfaceAppearance
,
这是从 EllipsoidSurfaceAppearance#fragmentShaderSource
、EllipsoidSurfaceAppearance#flat
、
和 EllipsoidSurfaceAppearance#faceForward
的 SurfaceSurfaceAppearance 中。
Returns:
The full GLSL fragment shader source.
创建渲染状态。 这不是最终的渲染状态实例;相反
它可以包含与渲染状态相同的渲染状态属性的子集
在上下文中创建。
Returns:
渲染状态。
根据
EllipsoidSurfaceAppearance#translucent
和 Material#isTranslucent
确定几何体是否为半透明。
Returns:
如果外观为半透明,
则为 true
。