Texture Unit
- Tags
- opengl
The location (as in shader-location) is where a textures can be found in a shader.
The default texture-unit is 0, meaning that you can reference a uniform texture at
this location without assigning it first. For all other texture-units you must first
enable them (eg. glActiveTexture(GL_TEXTURE0)
) and then bind them
glBindTexture(GL_TEXTURE_2D, texture)
.
OpenGL makes 16 texture units (0-15) available for our use.