Appearance

new Cesium.Appearance(options)

外观定义了完整的GLSL顶点和片段着色器 用于绘制的渲染状态 Primitive. 所有外观实现 基本这个Appearance接口。
Name Type Description
options object optional 对象,具有以下属性:
Name Type Default Description
translucent boolean true optional 如果为 true,则几何体应显示为半透明,因此 Appearance#renderState 启用了 Alpha 混合。
closed boolean false optional 如果为 true,则预计几何体将被关闭,因此 Appearance#renderState 启用了背面剔除。
material Material Material.ColorType optional 用于确定片段颜色的材质。
vertexShaderSource string optional 可选的 GLSL 顶点着色器源,用于覆盖默认顶点着色器。
fragmentShaderSource string optional 可选的 GLSL 片段着色器源,用于覆盖默认片段着色器。
renderState object optional 可选的渲染状态来覆盖默认的渲染状态。
Demo:
See:

Members

readonly closed : boolean

如果为 true,则几何图形应为闭合。
Default Value: false

readonly fragmentShaderSource : string

片段着色器的 GLSL 源代码。 完整的片段着色器 source 是按照程序构建的,考虑了 Appearance#material。 使用 Appearance#getFragmentShaderSource 获取完整源代码。
用于确定片段颜色的材料。 与其他 外观 不同 属性,这不是只读的,因此外观的材质可以动态更改。
See:

readonly renderState : object

渲染几何体时使用的 WebGL 固定函数状态。

translucent : boolean

如果为 true,则几何体应显示为半透明。
Default Value: true

readonly vertexShaderSource : string

顶点着色器的 GLSL 源代码。

Methods

getFragmentShaderSource()string

以程序方式为此外观创建完整的 GLSL 片段着色器源 考虑到 Appearance#fragmentShaderSourceAppearance#material
Returns:
完整的 GLSL 片段着色器源。

getRenderState()object

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

isTranslucent()boolean

根据 Appearance#translucentMaterial#isTranslucent 确定几何体是否为半透明。
Returns:
true,如果外观是半透明的。
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.