new DebugAppearance()
Display vertex attributes in color to visualize them for debugging purposes. The components of the unit length vector, namely the normal, binary normal, and tangent, are scaled and biased from [-1.0, 1.0] to (-1.0, 1.0).
| Name | Type | Default | Description |
|---|---|---|---|
options.attributeName |
String |
The name of the attribute to be visualized. |
|
options.perInstanceAttribute |
Boolean |
Boolean value, determining whether this property is a geometric property of each instance. |
|
options.glslDatatype |
String | 'vec3' |
optional
GLSL data type for attributes. The supported data types are float, vec2, vec3, and vec4. |
options.vertexShaderSource |
String |
optional
Optional GLSL vertex shading source, overriding default vertex shading. |
|
options.fragmentShaderSource |
String |
optional
Optional GLSL fragment shader source, overriding default fragment shading. |
|
options.renderState |
RenderState |
optional
Optional presentation state, overriding the default presentation state. |
Throws:
-
Options.glslDatatype must be float, vec2, vec3, or vec4.
- Type
- DeveloperError
Example
var primitive = new SuperMap3D.Primitive({
geometryInstances : // ...
appearance : new SuperMap3D.DebugAppearance({
attributeName : 'normal'
})
});
Members
-
readonly attributeNameString
-
The name of the visualized attribute.
-
readonly closedBoolean
-
When true, it is expected that the geometry will be closed.
- Default Value: false
readonly fragmentShaderSourceString
GLSL source code for fragment shader. Considering the Debug Appearance # material, the complete fragment shader source code is built according to the program. Use Debug Appearance # getFragmentShaderSource to obtain the complete source code.
readonly glslDatatypeString
The GLSL data type of the visualized attribute.
materialMaterial
This attribute is part of the Appearance interface, but it is not used by Debug Appearance because it uses a fully customized fragment shader.
- Default Value: undefined
readonly renderStateObject
The WebGL fixed-function state used when rendering geometry.
translucentBoolean
When true, the geometry should be semi transparent.
- Default Value: false
readonly vertexShaderSourceString
GLSL source code for vertex shader.
Methods
-
getFragmentShaderSource(){String}
-
Return the complete GLSL fragment shader source, where debugAppearance is only debugAppearance # fragmentShaderSource.
Returns:
Type Description String Complete GLSL fragment shader source code. -
getRenderState(){Object}
-
Create presentation status. This is not the final rendering state instance. On the contrary, it can contain a subset of presentation state attributes that are the same as those created in the context.
Returns:
Type Description Object Present the status. -
isTranslucent(){Boolean}
-
Determine whether the geometry is semi transparent based on the Debug Appearance # semi transparent.
Returns:
Type Description Boolean If the appearance is semi transparent, it is True.