用于椭球表面几何(如
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
Procedurally creates the full GLSL fragment shader source. For
EllipsoidSurfaceAppearance,
this is derived from EllipsoidSurfaceAppearance#fragmentShaderSource, EllipsoidSurfaceAppearance#flat,
and EllipsoidSurfaceAppearance#faceForward.
Returns:
The full GLSL fragment shader source.
Creates a render state. This is not the final render state instance; instead,
it can contain a subset of render state properties identical to the render state
created in the context.
Returns:
The render state.
Determines if the geometry is translucent based on
EllipsoidSurfaceAppearance#translucent and Material#isTranslucent.
Returns:
true if the appearance is translucent.
