Jump to content
  • Advertisement
Sign in to follow this  
Bobboau

non-interleaved textures

This topic is 3747 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

is it possible? I doubt it, but I have found myself in an odd position where I am getting the rgba data in separate contiguous blocks and it would be real handy if I could make a texture in that manner. I know I can make textures that are just one color plane, but is there a way to have all four channels in separate blocks, like what can be done with vertex data? i.e. can I make textures that are of the format rrrrggggbbbbaaaa rather than rgbargbargbargba ?

Share this post


Link to post
Share on other sites
Advertisement
Vertex arrays doesn't allow you to store the individual color channels in separate blocks, and nor do textures. Unless you're willing to use four separate textures and combine them using a shader (resulting in four individual textures, not a single texture with separate channels), you cannot do that.

Share this post


Link to post
Share on other sites
Well, you could ....

What if you mapped your components to rgba i.e. source rrrr -> destination rgba
The texture would then have 4 blocks of rows where each pixel contains 4 actual pixels of one channel (i.e. pixel 0 would have r = r0, g = r1, g = r2, a = r3).

You'd still have to combine the channels in a shader, i.e. read 4 pixels (one from each channel block), extract the correct component and combine them to the final color.

But I'd say it's easier and more efficient to just use interleaved textures.

Share this post


Link to post
Share on other sites
well the thing is I'm getting four data streams right now, each is the same length, and made up of byte data, I'm currently having to combine them into the interleaved format into a new 1d texture every frame and using that in my shader. I would like to be able to just blit them to the buffer, but with interleaved formats, this isn't possible.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!