   One pass masking.
  I know how to do masking with two passes, but is there another way, one pass I mean?   "C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"  
  why masking at the firt place, use alpha testing or blending instead, and it is done in one pass... ;  What? I want a textured quad to be 100% transparent at some pixels and at others 100% opaque. It can be done with 32-bit tga (or other textures with alpha channel) right? How? I tried but no luck. Can you please post some code, an example?   "C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"  ;  Well, I know I am coming out of the blue a little bit here.  But you could do masking in a pixel shader.  I mean especially if you know ahead of time which polys have to be masked, then you could restrict the use of the shader to just those polys.  it would be a really really easy shader to implement as well as most likely only one pass on most cards.  though you may be steering clear of the whole shader driven approach at this time, this is just an idea, b/c I believe the future of graphics in general will very shortly move to a completely shader driven implementation (for obvious reasons).  Anyway I know this is not the answer you may be looking for, but its an idea.Rob ;  Well, yes it is not the answer I was looking for . May be vertex shaders but not pixel shaders.  Thanks anyway...   "C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"  ;  Have the alpha of transparent pixels be zero, all others be one.  Now you can do something likeglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);and render the triangle.;  Look at glEnable(GL_ALPHA_TEST).  This is what you want.  Nehe has an example of this exact thing. ;  if you want a masking effect with NO blending, only transparent and non-transparent pixels, do an alpha test rather than blending, it''s faster plus pixels that don''t pass the alpha test aren''t written to the zbuffer either which can be advantageous in that you *may* not need to sort your polygons before rendering. You still need an alpha component in your texture, so use TGA''s or something. ;  Oh man!! I have forgotten about alpha testing!! lol,  Thanks everybody!!   "C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"  