Back to Filament

attribute

docs/android/dokka/filament-android/com.google.android.filament/-vertex-buffer/-builder/attribute.md

1.75.02.8 KB
Original Source

//filament-android/com.google.android.filament/VertexBuffer/Builder/attribute

attribute

[main]
open fun attribute(attribute: VertexBuffer.VertexAttribute, bufferIndex: Int, attributeType: VertexBuffer.AttributeType, byteOffset: Int, byteStride: Int): VertexBuffer.Builder

Sets up an attribute for this vertex buffer set. Using byteOffset and byteStride, attributes can be interleaved in the same buffer.

This is a no-op if the attribute is an invalid enum. This is a no-op if the bufferIndex is out of bounds.

Warning: VertexAttribute.TANGENTS must be specified as a quaternion and is how normals are specified.

Return

A reference to this Builder for chaining calls.

Parameters

main

attributethe attribute to set up
bufferIndexthe index of the buffer containing the data for this attribute. Must be between 0 and bufferCount() - 1.
attributeTypethe type of the attribute data (e.g. byte, float3, etc...)
byteOffsetoffset in bytes into the buffer bufferIndex
byteStridestride in bytes to the next element of this attribute. When set to zero the attribute size, as defined by attributeType is used.

See also

VertexBuffer.VertexAttribute

[main]
open fun attribute(attribute: VertexBuffer.VertexAttribute, bufferIndex: Int, attributeType: VertexBuffer.AttributeType): VertexBuffer.Builder

Sets up an attribute for this vertex buffer set. Using byteOffset and byteStride, attributes can be interleaved in the same buffer.

This is a no-op if the attribute is an invalid enum. This is a no-op if the bufferIndex is out of bounds.

Warning: VertexAttribute.TANGENTS must be specified as a quaternion and is how normals are specified.

Return

A reference to this Builder for chaining calls.

Parameters

main

attributethe attribute to set up
bufferIndexthe index of the buffer containing the data for this attribute. Must be between 0 and bufferCount() - 1.
attributeTypethe type of the attribute data (e.g. byte, float3, etc...)

See also

VertexBuffer.VertexAttribute