VertexBuffer

actual 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 to 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.

See also

, RenderableManager

expect 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 to 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.

See also

, RenderableManager

actual class VertexBuffer(jsVertexBuffer: VertexBuffer, val vertexCount: Int = 0)

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 to 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.

See also

, RenderableManager

actual 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 to 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.

See also

, RenderableManager

actual 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 to 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.

See also

, RenderableManager

Constructors

Link copied to clipboard
constructor(jsVertexBuffer: VertexBuffer, vertexCount: Int = 0)

Types

Link copied to clipboard

Data types for vertex attributes.

Data types for vertex attributes.

Data types for vertex attributes.

Data types for vertex attributes.

Data types for vertex attributes.

Link copied to clipboard
actual class Builder

Builder for creating VertexBuffer instances.

expect class Builder

Builder for creating VertexBuffer instances.

actual class Builder

Builder for creating VertexBuffer instances.

actual class Builder

Builder for creating VertexBuffer instances.

actual class Builder

Builder for creating VertexBuffer instances.

Link copied to clipboard

Vertex attribute types that can be defined in a VertexBuffer.

Vertex attribute types that can be defined in a VertexBuffer.

Vertex attribute types that can be defined in a VertexBuffer.

Vertex attribute types that can be defined in a VertexBuffer.

Vertex attribute types that can be defined in a VertexBuffer.

Properties

Link copied to clipboard
val nativeVertexBuffer: VertexBuffer
Link copied to clipboard
actual val vertexCount: Int

Gets the number of vertices in each buffer of this set.

expect val vertexCount: Int

Gets the number of vertices in each buffer of this set.

actual val vertexCount: Int

Gets the number of vertices in each buffer of this set.

actual val vertexCount: Int

Gets the number of vertices in each buffer of this set.

actual val vertexCount: Int

Gets the number of vertices in each buffer of this set.

Functions

Link copied to clipboard
actual fun setBufferAt(engine: Engine, bufferIndex: Int, data: ByteArray)

Sets the data for a given buffer in this vertex buffer set.

actual fun setBufferAt(engine: Engine, bufferIndex: Int, data: ByteArray, destOffsetInBytes: Int, count: Int)

Sets the data for a given buffer with offset and count.

actual fun setBufferAt(engine: Engine, bufferIndex: Int, data: ByteArray, destOffsetInBytes: Int, count: Int, callback: () -> Unit?)

Sets the data for a given buffer with offset, count, and optional completion callback.

expect fun setBufferAt(engine: Engine, bufferIndex: Int, data: ByteArray)

Sets the data for a given buffer in this vertex buffer set.

expect fun setBufferAt(engine: Engine, bufferIndex: Int, data: ByteArray, destOffsetInBytes: Int, count: Int)

Sets the data for a given buffer with offset and count.

expect fun setBufferAt(engine: Engine, bufferIndex: Int, data: ByteArray, destOffsetInBytes: Int, count: Int, callback: () -> Unit? = null)

Sets the data for a given buffer with offset, count, and optional completion callback.

actual fun setBufferAt(engine: Engine, bufferIndex: Int, data: ByteArray)

Sets the data for a given buffer in this vertex buffer set.

actual fun setBufferAt(engine: Engine, bufferIndex: Int, data: ByteArray, destOffsetInBytes: Int, count: Int)

Sets the data for a given buffer with offset and count.

actual fun setBufferAt(engine: Engine, bufferIndex: Int, data: ByteArray, destOffsetInBytes: Int, count: Int, callback: () -> Unit?)

Sets the data for a given buffer with offset, count, and optional completion callback.

actual fun setBufferAt(engine: Engine, bufferIndex: Int, data: ByteArray)

Sets the data for a given buffer in this vertex buffer set.

actual fun setBufferAt(engine: Engine, bufferIndex: Int, data: ByteArray, destOffsetInBytes: Int, count: Int)

Sets the data for a given buffer with offset and count.

actual fun setBufferAt(engine: Engine, bufferIndex: Int, data: ByteArray, destOffsetInBytes: Int, count: Int, callback: () -> Unit?)

Sets the data for a given buffer with offset, count, and optional completion callback.

actual fun setBufferAt(engine: Engine, bufferIndex: Int, data: ByteArray)

Sets the data for a given buffer in this vertex buffer set.

actual fun setBufferAt(engine: Engine, bufferIndex: Int, data: ByteArray, destOffsetInBytes: Int, count: Int)

Sets the data for a given buffer with offset and count.

actual fun setBufferAt(engine: Engine, bufferIndex: Int, data: ByteArray, destOffsetInBytes: Int, count: Int, callback: () -> Unit?)

Sets the data for a given buffer with offset, count, and optional completion callback.

Link copied to clipboard
actual fun setBufferObjectAt(engine: Engine, bufferIndex: Int, bufferObject: BufferObject)

Associates a BufferObject with a buffer in this vertex buffer set.

expect fun setBufferObjectAt(engine: Engine, bufferIndex: Int, bufferObject: BufferObject)

Associates a BufferObject with a buffer in this vertex buffer set.

actual fun setBufferObjectAt(engine: Engine, bufferIndex: Int, bufferObject: BufferObject)

Associates a BufferObject with a buffer in this vertex buffer set.

actual fun setBufferObjectAt(engine: Engine, bufferIndex: Int, bufferObject: BufferObject)

Associates a BufferObject with a buffer in this vertex buffer set.

actual fun setBufferObjectAt(engine: Engine, bufferIndex: Int, bufferObject: BufferObject)

Associates a BufferObject with a buffer in this vertex buffer set.