The Techel
The Techel

Reputation: 873

glTexImage2D: Generic InternalFormat

The documentation of glTexImage2D for internalformat states, that it may be 1, 2, 3, or 4 to specify the number of components. Does this only apply to 'color'-textures or could I pass 1 instead of GL_DEPTH_COMPONENT and subsequently use it as a depth buffer target?

Upvotes: 1

Views: 93

Answers (1)

Nicol Bolas
Nicol Bolas

Reputation: 474436

If you use generic numbers (which you should never do. Always use internal formats with explicit sizes), then you will get a color image format with at least as many channels as you ask for.

Upvotes: 3

Related Questions