Appearance

new Cesium.Appearance(options)

Appearance定义了完整的GLSL顶点和片段着色器,以及用于绘制Primitive的渲染状态。 所有的appearances实现都基于这个基础的Appearance接口。
Name Type Description
options Object optional 具有下列属性的对象:
Name Type Default Description
translucent Boolean true optionaltrue时,几何图形应该显示为半透明,因此Appearance#renderState启用了alpha混合。
closed Boolean false optionaltrue时,几何图形将被关闭,因此Appearance#renderState启用了背面剔除。
material Material Material.ColorType optional 用于确定片元颜色的材质。
vertexShaderSource String optional 可选的GLSL顶点着色器源,用于覆盖默认的顶点着色器。
fragmentShaderSource String optional 可选的GLSL片段着色器源,用于覆盖默认的片段着色器。
renderState RenderState optional 可选的渲染状态,用于覆盖默认的渲染状态。
Demo:
See:

Members

readonlyclosed : Boolean

true时,启用背面剔除。
Default Value: false

readonlyfragmentShaderSource : String

片段着色器的GLSL源代码。 完整的片段着色器源代码是根据Appearance#material构建的,使用Appearance#getFragmentShaderSource获取完整的源代码。
用于确定片元颜色的材质。与其他Appearance的属性不同,它不是只读的,所以外观的材质可以动态改变。
See:

readonlyrenderState : Object

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

translucent : Boolean

true时,启用了alpha混合。
Default Value: true

readonlyvertexShaderSource : String

顶点着色器的GLSL源代码。

Methods

getFragmentShaderSource()String

获取基于Appearance#fragmentShaderSourceAppearance#material, 为这个外观创建的完整的GLSL片段着色器源。
Returns:
完整的GLSL片段着色器。

getRenderState()Object

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

isTranslucent()Boolean

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