jit.gl.buffer Reference

A buffer of mesh data on the GPU

jit.gl.buffer

Description

The jit.gl.buffer object is a named reference to a buffer of data stored on the GPU. The data is rendered via jit.gl.mesh, and jit.gl.tf is used to perform transform feedback effects.

Attributes

instance_div [int]

Divides the buffer by the value and applies the values across the total number of instances (default = 1). For example, could be used to create color groups in a large array of mesh instances. Requires instanced enabled.

instanced [int]

Enabling allows the buffer texture to pass different values to each drawn instance of a mesh when using jit.gl.mesh to perform hardware instancing (default = 0).

name [symbol]

g/s(get)

Used internally to manage texture buffers.

outname [symbol]

Required for use with jit.gl.tf, this name is used in the jit.gl.shader transform feedback shader code to process iterations of data on the buffer on the GPU. See the transform-feedback guide for more information.

texbuf [int]

When enabled, the buffer is bound as a texture buffer, allowing for texture-style lookups in the shader code (default = 0). It is important to note that any normal textures will be bound first, and then texture buffers.

type [symbol]

Sets the type of the buffer to bind to as a texture (position, normal, color, vertex_attr0, etc). When passed to a jit.gl.mesh (or through a jit.gl.tf, then to a jit.gl.mesh), it will bind the texture to the mesh object's corresponding internal buffer.
The following types are supported:

  • position
  • texcoord
  • normal
  • tangent
  • bitangent
  • vertex_attr
  • vertex_attr0
  • vertex_attr1
  • vertex_attr2
  • vertex_attr3

Common Box Attributes

Messages

bang

Outpus the currently stored buffer out the left outlet as the message jit_gl_buffer followed by the buffer name.

See Also

Name Description
GL3 Package Topics GL3 Package Topics
jit.gl.tf
jit.gl.mesh
jit.gl.shader