[][src]Module glin::attributes

glsl attributes and utilities to represent them in vaos

Most of the time the elements in this module are only used internally since attributes are usually extracted from reading the available ones in glsl programs and using the glin_proc crate to anotate the vertex types being used rather than having to manually create any of the structs in this module.

VAO in glin follow a model in which a buffer can be bound to one or more vertex binding points. Then one or more attributes can read from a vertex binding point.

The binding of a buffer to a vertex binding point is represented by VertexBufferBinding

The relation between an attribute and a vertex binding point is represented by an AttributeBufferBinding which is a trait implemented by a tuple of a Format + the index of the vertex buffer point.

A Format represents the format of the attribute and it's offset in the vertex.



Attribute format for most data types


Attribute format for matrices


Representation of a binding of a buffer to a vertex buffer binding point



OpenGL supported attribute types



Trait to implment gl::EnableVertexAttribArray or gl::VertexArrayAttribBinding


Attribute bindings in a program


Representation of a vertex element as an attribute in a GL buffer


Implemented by vertex types to convert attribute bindings into attribute formats