quick opengl 2d quad question

dave05
Unregistered
 
Post: #1
is it possible to apply an alpha mask to a texture before rendering it to the screen? I'm using opengl for 2d purposes. I would have a seperate texture to represent the alpha channel, i guess...
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #2
Unless you are using rectangle textures (non-POT), then the values passed glTexCoord will always refer to percentages of the texture. Of course, if you know the texture's width and height you could figure out the percentage that would equal a certain number of pixels.
Quote this message in a reply
Sage
Posts: 1,234
Joined: 2002.10
Post: #3
All hardware that OS X supports has as least two texture units, so you could bind your alpha texture to the second unit and use multitexturing to perform the masking.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  opengl view question Leroy 3 3,679 Jul 23, 2007 11:08 PM
Last Post: AnotherJake
  2d opengl lighting question Leroy 9 7,733 Jul 21, 2007 11:41 PM
Last Post: OneSadCookie
  Y value of a point on a quad evenmybird 5 3,994 Aug 6, 2006 02:32 PM
Last Post: OneSadCookie
  Quick question, will glCopyTexSubImage2D with with RECT textures? TomorrowPlusX 28 9,972 Jun 8, 2006 07:04 PM
Last Post: akb825
  Quad Vertex Array Woes WakingJohn 1 2,583 Apr 9, 2005 07:55 PM
Last Post: WakingJohn