通过将顶点属性显示为调试颜色来可视化它。 Visualizes a vertex attribute by displaying it as a color for debugging.
众所周知的单位长度向量的组成部分,即 Components for well-known unit-length vectors, i.e., normal,
tangent, 和 , and bitangent,从 [-1.0, 1.0] 缩放并偏置到 (-1.0, 1.0)。 , are scaled and biased from [-1.0, 1.0] to (-1.0, 1.0).
| 名称 Name | 类型 Type | 说明 Description | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
具有以下属性的对象: Object with the following properties:
|
抛出: Throws:
-
DeveloperError :options.glslDatatype 必须是 float、vec2、vec3 或 vec4。 : options.glslDatatype must be float, vec2, vec3, or vec4.
示例: Example:
const primitive = new Cesium.Primitive({
geometryInstances : // ...
appearance : new Cesium.DebugAppearance({
attributeName : 'normal'
})
});
成员 Members
正在可视化的属性的名称。 The name of the attribute being visualized.
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
DebugAppearance#material。使用 . Use DebugAppearance#getFragmentShaderSource 获得完整的源码。 to get the full source.
正在可视化的属性的 GLSL 数据类型。 The GLSL datatype of the attribute being visualized.
此属性是 This property is part of the
Appearance 接口,但不被使用 interface, but is not used by DebugAppearance 因为使用了完全自定义的片段着色器。 since a fully custom fragment shader is used.
-
默认值: Default Value:
undefined
渲染几何体时使用的 WebGL 固定功能状态。 The WebGL fixed-function state to use when rendering the geometry.
When
true,几何体预计会呈现半透明。 , the geometry is expected to appear translucent.
-
默认值: Default Value:
false
顶点着色器的 GLSL 源代码。 The GLSL source code for the vertex shader.
方法 Methods
返回完整的 GLSL 片段着色器源,其中 Returns the full GLSL fragment shader source, which for
DebugAppearance 只是 is just
DebugAppearance#fragmentShaderSource.
返回: 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
DebugAppearance#translucent.
返回: Returns:
true 如果外观是半透明的。 if the appearance is translucent.
