Skip to content

KBE3D / KBCore / Cesium / Appearance

类: Appearance

An appearance defines the full GLSL vertex and fragment shaders and the render state used to draw a Primitive. All appearances implement this base <code>Appearance</code> interface.

参数

Object with the following properties:

参数

When <code>true</code>, the geometry is expected to appear translucent so Appearance#renderState has alpha blending enabled.

参数

When <code>true</code>, the geometry is expected to be closed so Appearance#renderState has backface culling enabled.

参数

The material used to determine the fragment color.

参数

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

The material used to determine the fragment color. Unlike other Appearance properties, this is not read-only, so an appearance's material can change on the fly.


translucent

translucent: boolean

When <code>true</code>, the geometry is expected to appear translucent.


vertexShaderSource

readonly vertexShaderSource: string

The GLSL source code for the vertex shader.


fragmentShaderSource

readonly fragmentShaderSource: string

The GLSL source code for the fragment shader. The full fragment shader source is built procedurally taking into account the Appearance#material. Use Appearance#getFragmentShaderSource to get the full source.


renderState

readonly renderState: any

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


closed

readonly closed: boolean

When <code>true</code>, the geometry is expected to be closed.

方法

getFragmentShaderSource()

getFragmentShaderSource(): string

Procedurally creates the full GLSL fragment shader source for this appearance taking into account Appearance#fragmentShaderSource and Appearance#material.

返回

string

The full GLSL fragment shader source.


isTranslucent()

isTranslucent(): boolean

Determines if the geometry is translucent based on Appearance#translucent and Material#isTranslucent.

返回

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 Appearance(options?: { translucent?: boolean; closed?: boolean; material?: Material; vertexShaderSource?: string; fragmentShaderSource?: string; renderState?: any; }): Appearance

参数

options?
translucent?

boolean

closed?

boolean

material?

Material

vertexShaderSource?

string

fragmentShaderSource?

string

renderState?

any

返回

Appearance

KBE3D @3.0.0 Copyright © 2024-present KBE3D