I’ve got a pbo that exceeds the max texture dimension. The data is actually 3d voxel data. I’m processing the data in Cuda via a pbo binding… but also need access to the same data in glsl for display. I could easily fit the data in 2 separate textures… and that’s probably the route I’ll end up taking… but I wanted to try if I could use a multi channel texture to stuff it all into one texture id;
I want to copy a chunk of data to the RED channel and then copy the next chunk of data to the green channel. By default this doesn’t work, and it’s in the spec; If you copy just the GL_RED component to an RGB texture it will set the other components to 0. So I’m looking for the equivalent of say glColorMask… if glColorMask worked on glTexSubImage2D I would do this;
glBindBufferARB(); // bind very large pbo
glTexSubImage2D(…, GL_RED, GL_FLOAT, 0);
glColorMask(GL_FALSE, GL_TRUE, GL_FALSE, GL_FALSE);
glTexSubImage2D(…, GL_GREEN, GL_FLOAT, offset);
Any ideas other than using multiple textures?