Package 

Class VertexBuffer.Builder

    • Constructor Detail

      • VertexBuffer.Builder

        VertexBuffer.Builder()
    • 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 byteOffset and byteStride, attributes can be interleavedin 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 ishow normals are specified.

        Parameters:
        attribute - the attribute to set up
        bufferIndex - 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 buffer bufferIndex
        byteStride - 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 byteOffset and byteStride, attributes can be interleavedin 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 ishow normals are specified.

        Parameters:
        attribute - the attribute to set up
        bufferIndex - 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 to
        enabled - true to automatically normalize the given attribute