Appearance

new Cesium.Appearance(options)

外观定义完整的GLSL顶点和片段着色器以及 用于绘制Primitive的呈现状态。所有外观实施 这个基址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 fragment shader source来覆盖默认片段着色器。
renderState Object optional 可选渲染状态以覆盖默认渲染状态。
Demo:
See:

Members

readonly closed : Boolean

true时,几何图形将关闭。
Default Value: false

readonly fragmentShaderSource : String

片段着色器的GLSL源代码。完整片段着色器 源代码的构建过程中考虑了Appearance#material。 使用Appearance#getFragmentShaderSource获取完整源代码。
用来确定碎片颜色的材料。不像其他的Appearance 属性,这不是只读的,因此外观的材质可以动态更改。
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