VertexLayout
Index
Constructors
Accessors
Methods
Constructors
constructor
Parameters
options: VertexLayoutOptions
Returns VertexLayout
Accessors
publicattributes
Returns readonly [name: string, numberOfComponents: number, type?: int | matrix | float][]
publicshader
publictotalVertexSizeBytes
Total number of bytes that the vertex will take up
Returns number
publicvertexBuffer
Returns VertexBuffer
Methods
initialize
Layouts need shader locations and must be bound to a shader
Returns void
use
Bind this layout with it's associated vertex buffer
Parameters
uploadBuffer: boolean = false
Optionally indicate you wish to upload the buffer to the GPU associated with this layout
optionalcount: number
Returns void
Helper around creating vertex attributes in a given VertexBuffer, this is useful for describing the memory layout for your vertices inside a particular buffer
Note: This helper assumes interleaved attributes in one VertexBuffer, not many.
Working with
gl.vertexAttribPointer
can be tricky, and this attempts to double check you