Jump to content
  • Advertisement

Archived

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

danielk

Multitexturing & alpha channel

This topic is 5675 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
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
×

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!