Advertisement

Multitexturing & alpha channel

Started by February 02, 2003 07:45 AM
2 comments, last by danielk 22 years, 1 month ago
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
Transformers Rulez!!
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.
If at first you don't succeed, redefine success.
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.
- To learn, we share... Give some to take some -
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 - |

This topic is closed to new replies.

Advertisement