A shader program encapsulates a vertex and fragment shader pair linked to form a shader program useable with OpenGL ES 2.0.
After construction a ShaderProgram can be used to draw {@link Mesh}. To make the GPU use a specific ShaderProgram the programs {@link ShaderProgram#begin()} method must be used which effectively binds the program.
When a ShaderProgram is bound one can set uniforms, vertex attributes and attributes as needed via the respective methods.
A ShaderProgram can be unbound with a call to {@link ShaderProgram#end()}
A ShaderProgram must be disposed via a call to {@link ShaderProgram#dispose()} when it is no longer needed
ShaderPrograms are managed. In case the OpenGL context is lost all shaders get invalidated and have to be reloaded. This happens on Android when a user switches to another application or receives an incoming call. Managed ShaderPrograms are automatically reloaded when the OpenGL context is recreated so you don't have to do this manually.
@author mzechner
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|