Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface GLBufferAttribute

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. The most common use case for this class is when some kind of GPGPU calculation interferes or even produces the VBOs in question.

Hierarchy

  • GLBufferAttribute

Index

Constructors

constructor

  • new GLBufferAttribute(buffer: WebGLBuffer, type: number, itemSize: number, elementSize: 1 | 2 | 4, count: number): I3JS.GLBufferAttribute
  • gl.FLOAT: 4 gl.UNSIGNED_SHORT: 2 gl.SHORT: 2 gl.UNSIGNED_INT: 4 gl.INT: 4 gl.BYTE: 1 gl.UNSIGNED_BYTE: 1

    Parameters

    • buffer: WebGLBuffer

      Must be a WebGLBuffer.

    • type: number
    • itemSize: number

      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.

    • elementSize: 1 | 2 | 4

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

    • count: number

      The expected number of vertices in VBO.

    Returns I3JS.GLBufferAttribute

Properties

buffer

buffer: WebGLBuffer

The current WebGLBuffer instance.

count

count: number

The expected number of vertices in VBO.

elementSize

elementSize: 1 | 2 | 4

Stores the corresponding size in bytes for the current type property value. See above (constructor) for a list of known type sizes.

Readonly isGLBufferAttribute

isGLBufferAttribute: true

Read-only. Always true.

itemSize

itemSize: number

How many values make up each item (vertex).

type

type: number

A WebGL Data Type describing the underlying VBO contents. Set this property together with elementSize. The recommended way is using the setType method.

version

version: number

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

Accessors

needsUpdate

  • set needsUpdate(value: boolean): void

Methods

setBuffer

setCount

setItemSize

setType

Generated using TypeDoc