docs/android/dokka/filament-android/com.google.android.filament/-vertex-buffer/index.md
//filament-android/com.google.android.filament/VertexBuffer
open class VertexBuffer
Holds a set of buffers that define the geometry of a Renderable.
The geometry of the Renderable itself is defined by a set of vertex attributes such as position, color, normals, tangents, etc...
There is no need to have a 1-to-1 mapping between attributes and buffer. A buffer can hold the data of several attributes -- attributes are then referred as being "interleaved".
The buffers themselves are GPU resources, therefore mutating their data can be relatively slow. For this reason, it is best to separate the constant data from the dynamic data into multiple buffers.
It is possible, and even encouraged, to use a single vertex buffer for several Renderables.
| IndexBuffer |
| RenderableManager |
| Name | Summary |
|---|---|
| AttributeType | [main] |
| enum AttributeType | |
| Builder | [main] |
| open class Builder | |
| VertexAttribute | [main] |
| enum VertexAttribute |
| Name | Summary |
|---|---|
| getNativeObject | [main] |
| open fun getNativeObject(): Long | |
| getVertexCount | [main] |
| open fun getVertexCount(): Int | |
| Returns the vertex count. | |
| setBufferAt | [main] |
| open fun setBufferAt(engine: Engine, bufferIndex: Int, buffer: Buffer) | |
| Asynchronously copy-initializes the specified buffer from the given buffer data. | |
| [main] | |
| open fun setBufferAt(engine: Engine, bufferIndex: Int, buffer: Buffer, destOffsetInBytes: Int, count: Int) | |
| open fun setBufferAt(engine: Engine, bufferIndex: Int, buffer: Buffer, destOffsetInBytes: Int, count: Int, handler: Any, callback: Runnable) | |
| Asynchronously copy-initializes a region of the specified buffer from the given buffer data. | |
| setBufferObjectAt | [main] |
| open fun setBufferObjectAt(engine: Engine, bufferIndex: Int, bufferObject: BufferObject) | |
| Swaps in the given buffer object. |