SemiTransparent OpenGL Masking

ededed
Unregistered
 
Post: #1
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:
Quote this message in a reply
ylaporte
Unregistered
 
Post: #2
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 this message in a reply
Member
Posts: 204
Joined: 2002.09
Post: #3
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
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  OpenGL ES Texture Masking airfire 6 14,964 Mar 17, 2014 07:07 PM
Last Post: baioses
  OpenGL ES Texture Masking dalasjoe sin 0 3,883 Apr 13, 2012 12:17 AM
Last Post: dalasjoe sin
  Masking without a stencil buffer? Bachus 12 13,601 Sep 2, 2010 02:42 PM
Last Post: Skorche
  Alpha Masking Problem bonanza 5 3,803 Jun 29, 2008 11:58 AM
Last Post: maximile
  Masking Jake 12 4,955 Jun 29, 2005 02:04 PM
Last Post: TomorrowPlusX