Selva Compute API Reference - v1.1.2
    Preparing search index...

    This buffer attribute class does not construct a VBO. Instead, it uses whatever VBO is passed in constructor and can later be altered via the .buffer property.

    It is required to pass additional params alongside the VBO Those are: the GL context, the GL data type, the number of components per vertex, the number of bytes per component, and the number of vertices.

    Index

    Constructors

    • This creates a new GLBufferAttribute object.

      Parameters

      • buffer: WebGLBuffer

        Must be a WebGLBuffer. See .buffer

      • type: number

        One of WebGL Data Types. See .type

      • itemSize: number

        How many values make up each item (vertex). See .itemSize

      • elementSize: 1 | 2 | 4

        1, 2 or 4. The corresponding size (in bytes) for the given type param. See .elementSize

      • count: number

        The expected number of vertices in VBO. See .count

      • Optionalnormalized: boolean

        Whether the data are normalized or not.

      Returns GLBufferAttribute

    Properties

    buffer: WebGLBuffer

    The current WebGLBuffer instance.

    count: number

    The expected number of vertices in VBO.

    Expects a Integer

    elementSize: 1 | 2 | 4

    Stores the corresponding size in bytes for the current .type property value.

    The corresponding size (in bytes) for the given "type" param.

    • gl.BYTE: 1
    • gl.UNSIGNED_BYTE: 1
    • gl.SHORT: 2
    • gl.UNSIGNED_SHORT: 2
    • gl.INT: 4
    • gl.UNSIGNED_INT: 4
    • gl.FLOAT: 4

    Set this property together with .type. The recommended way is using the .setType method.

    constructor`` for a list of known type sizes. @remarks Expects a 1, 2or4`

    isGLBufferAttribute: true

    Read-only flag to check if a given object is of type GLBufferAttribute.

    This is a constant value

    true

    itemSize: number

    How many values make up each item (vertex).

    The number of values of the array that should be associated with a particular vertex. For instance, if this attribute is storing a 3-component vector (such as a position, normal, or color), then itemSize should be 3.

    name: string

    Optional name for this attribute instance.

    ""

    normalized: boolean

    Applies to integer data only. Indicates how the underlying data in the buffer maps to the values in the GLSL code. For instance, if buffer contains data of gl.UNSIGNED_SHORT, and normalized is true, the values 0 - +65535 in the buffer data will be mapped to 0.0f - +1.0f in the GLSL attribute. If normalized is false, the values will be converted to floats unmodified, i.e. 65535 becomes 65535.0f.

    type: number

    A WebGL Data Type describing the underlying VBO contents.

    • gl.BYTE: 0x1400
    • gl.UNSIGNED_BYTE: 0x1401
    • gl.SHORT: 0x1402
    • gl.UNSIGNED_SHORT: 0x1403
    • gl.INT: 0x1404
    • gl.UNSIGNED_INT: 0x1405
    • gl.FLOAT: 0x1406

    Set this property together with .elementSize. The recommended way is using the .setType() method.

    version: number

    A version number, incremented every time the needsUpdate property is set to true.

    Expects a Integer

    Accessors

    • set needsUpdate(value: boolean): void

      Setting this to true increments .version.

      Parameters

      • value: boolean

      Returns void

      set-only property.

    Methods

    • Sets the .buffer property.

      Parameters

      Returns this

    • Sets the count property.

      Parameters

      • count: number

      Returns this

    • Sets the itemSize property.

      Parameters

      • itemSize: number

      Returns this

    • Sets the both type and elementSize properties.

      Parameters

      • type: number
      • elementSize: 1 | 2 | 4

      Returns this