Reputation: 4915
I know it is simply not possible to have more than the four built-in texture components. At least directly. Generally, the proposed solution is simple - use multiple textures. However, I think that it is not optimal. Let's look at an example.
Let's say there is a basic material format that has the following properties:
The simplest way to store this data would be to use 4 diffrent textures with respectively 3, 3, 1, and 1 components. This is inefficient for at least two reasons:
The common way to deal with this would be to pack the data in the least amount if textures possible that also nicely align. In this case it could be put in two textures with 4 components each. This solves the first issue of wasted memory, but the second one still exists as it is still required to do 2 texture samples to read the data. 2 samples is not really a lot, but what if it could be reduced to just one?
My idea is to pack all 6 components in one texture. How? GL_RGB16_SNORM
. It is a texture internal format that albeit having only 3 components, could actually fit 6 because each pixel is 6 bytes.
So my question is:
Upvotes: 0
Views: 404
Reputation: 52083
Use an array texture & sample at the same (u,v) location in the other layers to retrieve your extra texture channel data.
Upvotes: 1