DebugAppearance

new Cesium.DebugAppearance(options)

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

参数名称 类型 描述信息
options object Object with the following properties:
参数名称 类型 默认值 描述信息
attributeName string The name of the attribute to visualize.
perInstanceAttribute boolean false 可选 Boolean that determines whether this attribute is a per-instance geometry attribute.
glslDatatype string 'vec3' 可选 The GLSL datatype of the attribute. Supported datatypes are float, vec2, vec3, and vec4.
vertexShaderSource string 可选 Optional GLSL vertex shader source to override the default vertex shader.
fragmentShaderSource string 可选 Optional GLSL fragment shader source to override the default fragment shader.
renderState object 可选 Optional render state to override the default render state.
Throws:
  • DeveloperError : options.glslDatatype must be float, vec2, vec3, or vec4.
使用示例:
const primitive = new Cesium.Primitive({
  geometryInstances : // ...
  appearance : new Cesium.DebugAppearance({
    attributeName : 'normal'
  })
});

成员(属性)

readonly attributeName : string

The name of the attribute being visualized.

readonly closed : boolean

When true, the geometry is expected to be closed.
默认值: false

readonly fragmentShaderSource : 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.

readonly glslDatatype : string

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.
默认值: undefined

readonly renderState : object

The WebGL fixed-function state to use when rendering the geometry.
When true, the geometry is expected to appear translucent.
默认值: false

readonly vertexShaderSource : string

The GLSL source code for the vertex shader.

方法

getFragmentShaderSource()string

Returns the full GLSL fragment shader source, which for DebugAppearance is just DebugAppearance#fragmentShaderSource.
返回值:
The full GLSL fragment shader source.

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.
返回值:
The render state.

isTranslucent()boolean

Determines if the geometry is translucent based on DebugAppearance#translucent.
返回值:
true if the appearance is translucent.