DebugAppearance - Cesium Documentation

# DebugAppearance

#### new DebugAppearance(options)

  Visualizes a vertex attribute by displaying it as a color for debugging.

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

  Name | Type | Description
  --- | --- | ---

  `options`

  Object

  Object with the following properties:

  Name | Type | Default | Description
  --- | --- | --- | ---
  `attributeName` | String |  | The name of the attribute to visualize.
  `glslDatatype` | String | `'vec3'` | optional The GLSL datatype of the attribute. Supported datatypes are `float`, `vec2`, `vec3`, and `vec4`.
  `vertexShaderSource` | String |  | optional Optional GLSL vertex shader source to override the default vertex shader.
  `fragmentShaderSource` | String |  | optional Optional GLSL fragment shader source to override the default fragment shader.
  `renderState` | RenderState |  | optional Optional render state to override the default render state.

  ##### Throws:

  - DeveloperError : options.glslDatatype must be float, vec2, vec3, or vec4.

  ##### Example:

      var primitive = new Cesium.Primitive({
        geometryInstances : // ...
        appearance : new Cesium.DebugAppearance({
          attributeName : 'normal'
        })
      });

  Source: Scene/DebugAppearance.js, line 44

### Members

#### readonlyattributeName :String

  The name of the attribute being visualized.
  Source: Scene/DebugAppearance.js, line 203

#### readonlyclosed :Boolean

  When `true`, the geometry is expected to be closed.
  Default Value: `false`
  Source: Scene/DebugAppearance.js, line 189

#### readonlyfragmentShaderSource :String

  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.
  Source: Scene/DebugAppearance.js, line 159

#### readonlyglslDatatype :String

  The GLSL datatype of the attribute being visualized.
  Source: Scene/DebugAppearance.js, line 217

#### material :Material

  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`
  Source: Scene/DebugAppearance.js, line 112

#### readonlyrenderState :Object

  The WebGL fixed-function state to use when rendering the geometry.
  Source: Scene/DebugAppearance.js, line 173

#### translucent :Boolean

  When `true`, the geometry is expected to appear translucent.
  Default Value: `false`
  Source: Scene/DebugAppearance.js, line 121

#### readonlyvertexShaderSource :String

  The GLSL source code for the vertex shader.
  Source: Scene/DebugAppearance.js, line 143

### Methods

#### getFragmentShaderSource()

  Returns the full GLSL fragment shader source, which for `DebugAppearance` is just `DebugAppearance#fragmentShaderSource`.

  ##### Returns:

  String The full GLSL fragment shader source.
  Source: Scene/DebugAppearance.js, line 232

#### 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.
  Source: Scene/DebugAppearance.js, line 252

#### isTranslucent() → Boolean

  Determines if the geometry is translucent based on `DebugAppearance#translucent`.

  ##### Returns:

  `true` if the appearance is translucent.
  Source: Scene/DebugAppearance.js, line 241