• Advertisement

Archived

This topic is now archived and is closed to further replies.

Multitexturing & alpha channel

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

Hey guys. Quick q. Is there any way I can take a greyscale image and instead of storing it as an RGB texture, can I store the values from 0 to 1 as alpha levels instead? How do I go about this? Thanks, all the best, Dan

Share this post


Link to post
Share on other sites
Advertisement
You use GL_ALPHA instead of GL_RGB when generating the texture.

Death of one is a tragedy, death of a million is just a statistic.

Share this post


Link to post
Share on other sites
as python_regious suggested, u use GL_ALPHA. however on ur issue of storing values from 0 to 1... may be complicated. to my understanding, each channel for an inmage is generally stored as an 8-bit integral. which means ur values range from 0 to 255.

so, yes a grayscale image can be handled thru GL_ALPHA. but if u wanna manipulate the data yourself, remember to do fractional conversion on ur own. adios.

Share this post


Link to post
Share on other sites
quote:

however on ur issue of storing values from 0 to 1... may be complicated. to my understanding, each channel for an inmage is generally stored as an 8-bit integral. which means ur values range from 0 to 255.



that doesn''t make any difference, as texture data is treated as if it were in the range 0 to 1. Although internally it''s still 0 to 255, so, for example, modulate blending of 128 and, say, 32 equals 16, not 4096.

| - Project-X - my mega project.. big things comming soon - | - adDeath - an ad blocker I made - | - email me - |

Share this post


Link to post
Share on other sites

  • Advertisement