SemiTransparent OpenGL Masking
Is there anyway of using blending and two textures to create a mask like
http://nehe.gamedev.net/tutorials/lesson.asp?l=20
but to have semi-transparent masking, how would you do that?
:confused:
http://nehe.gamedev.net/tutorials/lesson.asp?l=20
but to have semi-transparent masking, how would you do that?
:confused:
Quote:Originally posted by ededed
Is there anyway of using blending and two textures to create a mask like
http://nehe.gamedev.net/tutorials/lesson.asp?l=20
but to have semi-transparent masking, how would you do that?
:confused:
What I usually do myself if use textures with an alpha channel, glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) and play with the alpha component of glColor4f() for adjustments. I am not sure if that's what you want since it is using only one texture (and not two like you mentioned) but I am sure you could move memory around before sending the Texture to OpenGL. The idea would be to read the image you want as a mask as shades of grey then combine it with the color components from your other image then send it to OpenGL as a texture. Maybe there is a better/easier way to fo it tough.
Quote:Originally posted by ylaporte
The idea would be to read the image you want as a mask as shades of grey then combine it with the color components from your other image then send it to OpenGL as a texture. Maybe there is a better/easier way to fo it tough.
Check out NEHE's tutorials on reading targa (TGA) files. They can contain the alpha channel and hence are easy to read in and send to OpenGL. Much easier than using two separate textures, anyway.
Cheers,
Rocco
Virus Out
Big Bang Board Games
Adventures on Pirate Isle
Solace - Strategy, War, and Glory!
The Belt
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| OpenGL ES Texture Masking | airfire | 5 | 11,461 |
Nov 14, 2012 09:36 AM Last Post: toanNguyen |
|
| OpenGL ES Texture Masking | dalasjoe sin | 0 | 3,142 |
Apr 13, 2012 12:17 AM Last Post: dalasjoe sin |
|
| Masking without a stencil buffer? | Bachus | 12 | 10,744 |
Sep 2, 2010 02:42 PM Last Post: Skorche |
|
| Alpha Masking Problem | bonanza | 5 | 3,254 |
Jun 29, 2008 11:58 AM Last Post: maximile |
|
| Masking | Jake | 12 | 4,462 |
Jun 29, 2005 02:04 PM Last Post: TomorrowPlusX |
|

