Tutorial by Examples

Attributes are global state (*). If they were implemented in JavaScript they would look something like this // pseudo code gl = { ARRAY_BUFFER: null, vertexArray: { attributes: [ { enable: ?, type: ?, size: ?, normalize: ?, stride: ?, offset: ?, buffer: ? }, { enabl...
Uniforms are per program state. Every shader program has its own uniform state and its own locations.
Texture units are global state. If they were implemented in JavaScript they would look something like this // pseudo code gl = { activeTextureUnit: 0, textureUnits: [ { TEXTURE_2D: ?, TEXTURE_CUBE_MAP: ? }, { TEXTURE_2D: ?, TEXTURE_CUBE_MAP: ? }, { TEXTURE_2D: ?, TEXTURE_CUBE_...

Page 1 of 1