English中文

Appearance

new Cesium.Appearance(options)

外观定义了完整的 GLSL 顶点和片段着色器以及用于绘制的渲染状态 An appearance defines the full GLSL vertex and fragment shaders and the render state used to draw a Primitive。所有的外观都实现了这个基础 . All appearances implement this base Appearance interface.
名称 Name 类型 Type 说明 Description
options object 可选 optional 具有以下属性的对象: Object with the following properties:
名称 Name 类型 Type 默认值 Default 说明 Description
translucent boolean true 可选 optional When true,几何体预计会呈现半透明,因此 , the geometry is expected to appear translucent so Appearance#renderState 启用了 alpha 混合。 has alpha blending enabled.
closed boolean false 可选 optional When true,几何形状预计将是封闭的,因此 , the geometry is expected to be closed so Appearance#renderState 已启用背面剔除。 has backface culling enabled.
material Material Material.ColorType 可选 optional 用于确定片段颜色的材质。 The material used to determine the fragment color.
vertexShaderSource string 可选 optional 可选的 GLSL 顶点着色器源来覆盖默认顶点着色器。 Optional GLSL vertex shader source to override the default vertex shader.
fragmentShaderSource string 可选 optional 可选的 GLSL 片段着色器源来覆盖默认片段着色器。 Optional GLSL fragment shader source to override the default fragment shader.
renderState object 可选 optional 可选渲染状态覆盖默认渲染状态。 Optional render state to override the default render state.
演示: Demo:
另见: See:

成员 Members

readonly closed : boolean

When true,几何预计是封闭的。 , the geometry is expected to be closed.
默认值: Default Value: false

readonly fragmentShaderSource : string

片段着色器的 GLSL 源代码。完整的片段着色器源是在程序上构建的,考虑到 The GLSL source code for the fragment shader. The full fragment shader source is built procedurally taking into account the Appearance#material。使用 . Use Appearance#getFragmentShaderSource 获得完整的源码。 to get the full source.
用于确定片段颜色的材质。与其他不同 The material used to determine the fragment color. Unlike other Appearance 属性,这不是只读的,因此外观的材质可以动态更改。 properties, this is not read-only, so an appearance's material can change on the fly.
另见: See:

readonly renderState : object

渲染几何体时使用的 WebGL 固定功能状态。 The WebGL fixed-function state to use when rendering the geometry.

translucent : boolean

When true,几何体预计会呈现半透明。 , the geometry is expected to appear translucent.
默认值: Default Value: true

readonly vertexShaderSource : string

顶点着色器的 GLSL 源代码。 The GLSL source code for the vertex shader.

方法 Methods

getFragmentShaderSource()string

考虑到此外观,按程序创建完整的 GLSL 片段着色器源 Procedurally creates the full GLSL fragment shader source for this appearance taking into account Appearance#fragmentShaderSource and Appearance#material.
返回: Returns:
完整的 GLSL 片段着色器源代码。 The full GLSL fragment shader source.

getRenderState()object

创建渲染状态。这不是最终的渲染状态实例;相反,它可以包含与上下文中创建的渲染状态相同的渲染状态属性的子集。 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.

isTranslucent()boolean

确定几何体是否是半透明的 Determines if the geometry is translucent based on Appearance#translucent and Material#isTranslucent.
返回: Returns:
true 如果外观是半透明的。 if the appearance is translucent.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.