外观定义了完整的 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:
|
成员 Members
When
true,几何预计是封闭的。 , the geometry is expected to be closed.
-
默认值: Default Value:
false
片段着色器的 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.
material : Material
用于确定片段颜色的材质。与其他不同 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:
渲染几何体时使用的 WebGL 固定功能状态。 The WebGL fixed-function state to use when rendering the geometry.
When
true,几何体预计会呈现半透明。 , the geometry is expected to appear translucent.
-
默认值: Default Value:
true
顶点着色器的 GLSL 源代码。 The GLSL source code for the vertex shader.
方法 Methods
考虑到此外观,按程序创建完整的 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.
创建渲染状态。这不是最终的渲染状态实例;相反,它可以包含与上下文中创建的渲染状态相同的渲染状态属性的子集。 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
Appearance#translucent and Material#isTranslucent.
返回: Returns:
true 如果外观是半透明的。 if the appearance is translucent.
