Blending Textures...

Started by
0 comments, last by HellRiZZer 22 years, 5 months ago
How can I blend textures together with a mask as shown at http://www.flipcode.com/tpractice/issue05.shtml ? Is it the same as NeHe''s lesson 27 or 30? Please direct to the tut that has blending with mask please.. Thanks.
Advertisement
I think I''d do it by giving one texture the mask as an alpha channel and then blend the two textures together with SRC_ALPHA, ONE_MINUS_SRC_ALPHA. (Or the multitexturing equivalent of that, which should be a lot faster.)

Or do you mean, actually blending the textures together into a new texture which you can render? That would have to be done in software I suppose. Just do ResultPixelColor = Texture1PixelColor * MaskPixelColor + Texture2PixelColor * (1 - MaskPixelColor) for each pixel in the textures. (Assuming they''re of equal size and that the color values range from 0 to 1.)
Dirk =[Scarab]= Gerrits

This topic is closed to new replies.

Advertisement