Appearance
KBE3D / KBCore / Cesium / DebugAppearance
类: DebugAppearance
Visualizes a vertex attribute by displaying it as a color for debugging. <p> Components for well-known unit-length vectors, i.e., <code>normal</code>, <code>tangent</code>, and <code>bitangent</code>, are scaled and biased from [-1.0, 1.0] to (-1.0, 1.0). </p>
示例
ts
const primitive = new Cesium.Primitive({
geometryInstances : // ...
appearance : new Cesium.DebugAppearance({
attributeName : 'normal'
})
});参数
Object with the following properties:
参数
The name of the attribute to visualize.
参数
Boolean that determines whether this attribute is a per-instance geometry attribute.
参数
The GLSL datatype of the attribute. Supported datatypes are <code>float</code>, <code>vec2</code>, <code>vec3</code>, and <code>vec4</code>.
参数
Optional GLSL vertex shader source to override the default vertex shader.
参数
Optional GLSL fragment shader source to override the default fragment shader.
参数
Optional render state to override the default render state.
属性
material
material:
Material
This property is part of the Appearance interface, but is not used by DebugAppearance since a fully custom fragment shader is used.
translucent
translucent:
boolean
When <code>true</code>, the geometry is expected to appear translucent.
vertexShaderSource
readonlyvertexShaderSource:string
The GLSL source code for the vertex shader.
fragmentShaderSource
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.
renderState
readonlyrenderState:any
The WebGL fixed-function state to use when rendering the geometry.
closed
readonlyclosed:boolean
When <code>true</code>, the geometry is expected to be closed.
attributeName
readonlyattributeName:string
The name of the attribute being visualized.
glslDatatype
readonlyglslDatatype:string
The GLSL datatype of the attribute being visualized.
方法
getFragmentShaderSource()
getFragmentShaderSource():
string
Returns the full GLSL fragment shader source, which for DebugAppearance is just DebugAppearance#fragmentShaderSource.
返回
string
The full GLSL fragment shader source.
isTranslucent()
isTranslucent():
boolean
Determines if the geometry is translucent based on DebugAppearance#translucent.
返回
boolean
true if the appearance is translucent.
getRenderState()
getRenderState():
any
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.
返回
any
The render state.
构造函数
构造函数
new DebugAppearance(
options: {attributeName:string;perInstanceAttribute?:boolean;glslDatatype?:string;vertexShaderSource?:string;fragmentShaderSource?:string;renderState?:any; }):DebugAppearance
参数
options
attributeName
string
perInstanceAttribute?
boolean
glslDatatype?
string
vertexShaderSource?
string
fragmentShaderSource?
string
renderState?
any
返回
DebugAppearance
