• Advertisement
Sign in to follow this  

glTexImage2D - single channel blitting

This topic is 3992 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

Hi, I see the formats GL_RGBA and such, but is there a fast way of doing single channel blitting to a texture rather than storing, and updating a character array which I then have to blit? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
As long as the channel's data is all contiguous, just use GL_ALPHA for the format. This is assuming your texture data is in GL_ALPHA format. If not, then there is not a way to only update a single channel since the data is not stored contiguously.

Share this post


Link to post
Share on other sites
Thanks so much, that's a great help!


// to update only R channel from a continuous block of red pixel data
glTexImage2D (textarget, 0, GL_RGBA8, actual_width,
actual_height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, red_pixels-3);




[Edited by - Genjix on March 17, 2007 4:50:22 AM]

Share this post


Link to post
Share on other sites
spoke too soon... this doesn't seem to work (see a black texture) whereas normal GL_RGBA is working there fine. Any ideas why?

[Edited by - Genjix on March 17, 2007 4:17:05 AM]

Share this post


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

  • Advertisement