DebugAppearance

new Cesium.DebugAppearance(options)

通过将顶点属性显示为用于调试的颜色,将其可视化。

Components for well-known unit-length vectors, i.e., normal, tangent, and bitangent, are scaled and biased from [-1.0, 1.0] to (-1.0, 1.0).

Name Type Description
options Object 具有以下属性的对象:
Name Type Default Description
attributeName String 要可视化的属性的名称。
perInstanceAttribute Boolean false optional 布尔值,用于确定此属性是否为每个实例几何体属性。
glslDatatype String 'vec3' optional 属性的GLSL数据类型。支持的数据类型为floatvec2vec3vec4
vertexShaderSource String optional 可选的GLSL顶点着色器源来覆盖默认顶点着色器。
fragmentShaderSource String optional 可选的GLSL fragment shader source来覆盖默认片段着色器。
renderState Object optional 可选渲染状态以覆盖默认渲染状态。
Throws:
  • DeveloperError : 选项.glslDatatype必须是float、vec2、vec3或vec4。
Example:
var primitive = new Cesium.Primitive({
  geometryInstances : // ...
  appearance : new Cesium.DebugAppearance({
    attributeName : 'normal'
  })
});

Members

readonly attributeName : String

正在可视化的属性的名称。

readonly closed : Boolean

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

readonly fragmentShaderSource : String

片段着色器的GLSL源代码。完整片段着色器 源代码的构建过程中考虑了DebugAppearance#material。 使用DebugAppearance#getFragmentShaderSource获取完整源代码。

readonly glslDatatype : String

正在可视化的属性的GLSL数据类型。
此属性是Appearance接口的一部分,但不是 6866完全使用了自定义着色器6166。
Default Value: undefined

readonly renderState : Object

WebGL修复了渲染几何体时要使用的函数状态。

translucent : Boolean

true时,几何体看起来是半透明的。
Default Value: false

readonly vertexShaderSource : String

顶点着色器的GLSL源代码。

Methods

getFragmentShaderSource()String

返回完整的GLSL片段着色器源,对于DebugAppearance来说 DebugAppearance#fragmentShaderSource
Returns:
完整的GLSL片段着色器源。

getRenderState()Object

创建渲染状态。这不是最终渲染状态实例;而是, 它可以包含与渲染状态相同的渲染状态属性子集 在上下文中创建。
Returns:
渲染状态。

isTranslucent()Boolean

基于DebugAppearance#translucent确定几何体是否半透明。
Returns:
如果外观是半透明的,则为true