-
public class VertexBuffer.Builder
-
-
Constructor Summary
Constructors Constructor Description VertexBuffer.Builder()
-
Method Summary
Modifier and Type Method Description VertexBuffer.BuildervertexCount(@IntRange(from = 1) int vertexCount)Size of each buffer in this set, expressed in in number of vertices. VertexBuffer.BuilderenableBufferObjects(boolean enabled)Allows buffers to be swapped out and shared using BufferObject.If buffer objects mode is enabled, clients must call setBufferObjectAt rather thansetBufferAt. VertexBuffer.BuilderbufferCount(@IntRange(from = 1) int bufferCount)Defines how many buffers will be created in this vertex buffer set. VertexBuffer.Builderattribute(@NonNull() VertexBuffer.VertexAttribute attribute, @IntRange(from = 0) int bufferIndex, @NonNull() VertexBuffer.AttributeType attributeType, @IntRange(from = 0) int byteOffset, @IntRange(from = 0) int byteStride)Sets up an attribute for this vertex buffer set. VertexBuffer.Builderattribute(@NonNull() VertexBuffer.VertexAttribute attribute, @IntRange(from = 0) int bufferIndex, @NonNull() VertexBuffer.AttributeType attributeType)Sets up an attribute for this vertex buffer set. VertexBuffer.Buildernormalized(@NonNull() VertexBuffer.VertexAttribute attribute)Sets whether a given attribute should be normalized. VertexBuffer.Buildernormalized(@NonNull() VertexBuffer.VertexAttribute attribute, boolean enabled)Sets whether a given attribute should be normalized. VertexBufferbuild(@NonNull() Engine engine)Creates the VertexBufferobject and returns a pointer to it.-
-
Method Detail
-
vertexCount
@NonNull() VertexBuffer.Builder vertexCount(@IntRange(from = 1) int vertexCount)
Size of each buffer in this set, expressed in in number of vertices.
- Parameters:
vertexCount- number of vertices in each buffer in this set
-
enableBufferObjects
@NonNull() VertexBuffer.Builder enableBufferObjects(boolean enabled)
Allows buffers to be swapped out and shared using BufferObject.If buffer objects mode is enabled, clients must call setBufferObjectAt rather thansetBufferAt. This allows sharing of data between VertexBuffer objects, but it mayslightly increase the memory footprint of Filament's internal bookkeeping.
- Parameters:
enabled- If true, enables buffer object mode.
-
bufferCount
@NonNull() VertexBuffer.Builder bufferCount(@IntRange(from = 1) int bufferCount)
Defines how many buffers will be created in this vertex buffer set. These buffers arelater referenced by index from 0 to
bufferCount- 1.This call is mandatory. The default is 0.- Parameters:
bufferCount- number of buffers in this vertex buffer set.
-
attribute
@NonNull() VertexBuffer.Builder attribute(@NonNull() VertexBuffer.VertexAttribute attribute, @IntRange(from = 0) int bufferIndex, @NonNull() VertexBuffer.AttributeType attributeType, @IntRange(from = 0) int byteOffset, @IntRange(from = 0) int byteStride)
Sets up an attribute for this vertex buffer set.Using
byteOffsetandbyteStride, attributes can be interleavedin the same buffer.This is a no-op if the
attributeis an invalid enum.This is a no-op if thebufferIndexis out of bounds.Warning:
VertexAttribute.TANGENTSmust be specified as a quaternion and ishow normals are specified.- Parameters:
attribute- the attribute to set upbufferIndex- the index of the buffer containing the data for this attribute.attributeType- the type of the attribute data (e.g.byteOffset- offset in bytes into the bufferbufferIndexbyteStride- stride in bytes to the next element of this attribute.
-
attribute
@NonNull() VertexBuffer.Builder attribute(@NonNull() VertexBuffer.VertexAttribute attribute, @IntRange(from = 0) int bufferIndex, @NonNull() VertexBuffer.AttributeType attributeType)
Sets up an attribute for this vertex buffer set.Using
byteOffsetandbyteStride, attributes can be interleavedin the same buffer.This is a no-op if the
attributeis an invalid enum.This is a no-op if thebufferIndexis out of bounds.Warning:
VertexAttribute.TANGENTSmust be specified as a quaternion and ishow normals are specified.- Parameters:
attribute- the attribute to set upbufferIndex- the index of the buffer containing the data for this attribute.attributeType- the type of the attribute data (e.g.
-
normalized
@NonNull() VertexBuffer.Builder normalized(@NonNull() VertexBuffer.VertexAttribute attribute)
Sets whether a given attribute should be normalized. By default attributes are notnormalized. A normalized attribute is mapped between 0 and 1 in the shader. This appliesonly to integer types.
- Parameters:
attribute- enum of the attribute to set the normalization flag to
-
normalized
@NonNull() VertexBuffer.Builder normalized(@NonNull() VertexBuffer.VertexAttribute attribute, boolean enabled)
Sets whether a given attribute should be normalized. By default attributes are notnormalized. A normalized attribute is mapped between 0 and 1 in the shader. This appliesonly to integer types.
- Parameters:
attribute- enum of the attribute to set the normalization flag toenabled- true to automatically normalize the given attribute
-
-
-
-