# DebugAppearance

#### new Cesium.DebugAppearance(options)
engine/Source/Scene/DebugAppearance.js 35

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`, 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.
`perInstanceAttribute` | boolean | `false` | optional Boolean that determines whether this attribute is a per-instance geometry attribute.
`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` | object |  | optional Optional render state to override the default render state.

##### Throws:

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

##### Example:

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

### Members

#### readonly attributeName : string
engine/Source/Scene/DebugAppearance.js 215

The name of the attribute being visualized.

#### readonly closed : boolean
engine/Source/Scene/DebugAppearance.js 201

When `true`, the geometry is expected to be closed.

Default Value: `false`

#### readonly fragmentShaderSource : string
engine/Source/Scene/DebugAppearance.js 171

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.

#### readonly glslDatatype : string
engine/Source/Scene/DebugAppearance.js 229

The GLSL datatype of the attribute being visualized.

#### material : Material
engine/Source/Scene/DebugAppearance.js 120

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`

#### readonly renderState : object
engine/Source/Scene/DebugAppearance.js 185

The WebGL fixed-function state to use when rendering the geometry.

#### translucent : boolean
engine/Source/Scene/DebugAppearance.js 129

When `true`, the geometry is expected to appear translucent.

Default Value: `false`

#### readonly vertexShaderSource : string
engine/Source/Scene/DebugAppearance.js 155

The GLSL source code for the vertex shader.

### Methods

#### getFragmentShaderSource() → string
engine/Source/Scene/DebugAppearance.js 244

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

##### Returns:

The full GLSL fragment shader source.

#### getRenderState() → object
engine/Source/Scene/DebugAppearance.js 265

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
engine/Source/Scene/DebugAppearance.js 254

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

##### 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.