Skip to main content

VertexBuffer

Helper around vertex buffer to simplify creating and uploading geometry

Under the hood uses Float32Array

Index

Constructors

constructor

Properties

publicreadonlybuffer

buffer: WebGLBuffer

Access to the webgl buffer handle

publicreadonlybufferData

bufferData: Float32Array

Access to the raw data of the vertex buffer

publictype

type: static | dynamic = 'dynamic'

If the vertices never change switching 'static' can be more efficient on the gpu

Default is 'dynamic'

Methods

bind

  • bind(): void
  • Bind this vertex buffer


    Returns void

dispose

  • dispose(): void
  • Returns void

unbind

  • unbind(): void
  • Returns void

upload

  • upload(count?: number): void
  • Upload vertex buffer geometry to the GPU


    Parameters

    • optionalcount: number

    Returns void