A Mesh holds vertices composed of attributes specified by a {@link VertexAttributes} instance. The vertices are held either inVRAM in form of vertex buffer objects or in RAM in form of vertex arrays. The former variant is more performant and is prefered over vertex arrays if hardware supports it.
Meshes are automatically managed. If the OpenGL context is lost all vertex buffer objects get invalidated and must be reloaded when the context is recreated. This only happens on Android when a user switches to another application or receives an incoming call. A managed Mesh will be reloaded automagically so you don't have to do this manually.
A Mesh consists of vertices and optionally indices which specify which vertices define a triangle. Each vertex is composed of attributes such as position, normal, color or texture coordinate. Note that not all of this attributes must be given, except for position which is non-optional. Each attribute has an alias which is used when rendering a Mesh in OpenGL ES 2.0. The alias is used to bind a specific vertex attribute to a shader attribute. The shader source and the alias of the attribute must match exactly for this to work. For OpenGL ES 1.x rendering this aliases are irrelevant.
Meshes can be used with either OpenGL ES 1.x or OpenGL ES 2.0.
@author mzechner, Dave Clayton
|
|
|
|
|
|
|
|
|
|
|
|
|
|