new DebugAppearance()
以颜色显示顶点属性,使其可视化,以便调试。 单位长度向量的分量,即法线、二法线和正切,被缩放和偏置,从[-1.0,1.0]到(-1.0,1.0)。
| Name | Type | Default | Description |
|---|---|---|---|
options.attributeName |
String |
要可视化的属性的名称。 |
|
options.perInstanceAttribute |
Boolean |
布尔值,确定此属性是否为每个实例的几何属性。 |
|
options.glslDatatype |
String | 'vec3' |
可选
属性的GLSL数据类型。支持的数据类型有 |
options.vertexShaderSource |
String |
可选
可选的GLSL顶点着色源,覆盖默认顶点着色。 |
|
options.fragmentShaderSource |
String |
可选
可选的GLSL片段着色源,覆盖默认的片段着色。 |
|
options.renderState |
RenderState |
可选
可选的呈现状态,覆盖默认呈现状态。 |
Throws:
-
options.glslDatatype 必须为float、vec2、vec3或vec4。
- Type
- DeveloperError
Example
var primitive = new SuperMap3D.Primitive({
geometryInstances : // ...
appearance : new SuperMap3D.DebugAppearance({
attributeName : 'normal'
})
});
Members
-
readonly attributeNameString
-
被可视化的属性的名称。
-
readonly closedBoolean
-
当为true时,预计几何体将封闭。
- Default Value: false
readonly fragmentShaderSourceString
片段着色器的GLSL源代码。考虑到DebugAppearance#material,完整的片段着色器源代码是按程序构建的。使用DebugAppearance#getFragmentShaderSource获取完整的源代码。
readonly glslDatatypeString
被可视化的属性的GLSL数据类型。
materialMaterial
这个属性是Appearance接口的一部分,但是没有被DebugAppearance使用,因为它使用了一个完全自定义的片段着色器。
- Default Value: undefined
readonly renderStateObject
渲染几何体时使用的WebGL固定函数状态。
translucentBoolean
当为true时,几何体应该是半透明的。
- Default Value: false
readonly vertexShaderSourceString
顶点着色器的GLSL源代码。
Methods
-
getFragmentShaderSource(){String}
-
返回完整的GLSL片段着色器源,其中
DebugAppearance只是DebugAppearance#fragmentShaderSource。Returns:
Type Description String 完整的GLSL片段着色器源代码。 -
getRenderState(){Object}
-
创建呈现状态。这不是最终渲染状态实例。相反,它可以包含与在上下文中创建的呈现状态相同的呈现状态属性子集。
Returns:
Type Description Object 呈现状态。 -
isTranslucent(){Boolean}
-
根据
DebugAppearance#半透明决定几何体是否是半透明的。Returns:
Type Description Boolean 如果外观是半透明的,则为True。