   How to do this blend without two passes?
  Hello everyone.. i am trying to achieve this look:http://s7.photobucket.com/albums/y298/kool2rul/?action=view&current=effect.jpgsee how the text is fading above, thats what i want.. now the catch here is that firstly the text "Rapchik" is going to have an animated texture masked to it.. secondly i dont want it to just fade out by having the same colour.. i will add another background so i want the text to fade by alpha..Now i am able to do this like so:glBlendFunc(GL_DST_ALPHA, GL_ZERO); // Multiply the gradient mask alpha values with the credit sheet alpha valuesglColorMask(false, false, false, true);texMgr.drawTex(menuGradientTex); // Render the background alpha maskcredits.render();  // First credit render pass, to write the alpha valuesglColorMask(true, true, true, true);glBlendFunc(GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA);credits.render(); // Render credits again this time allowing ogl to write to the colour bufferbut for some reason i cant get it perfect with just one pass.. that is rendering the credits just once.. i am using opengl es so using two passes for animated textures kills the fps..btw credits sheet:http://s7.photobucket.com/albums/y298/kool2rul/?action=view&current=CreditSheet.jpgand menu gradient:http://s7.photobucket.com/albums/y298/kool2rul/?action=view&current=MenuGradient.jpg[Edited by - RapchikProgrammer on May 15, 2010 9:46:19 AM]
  What's stopping you from rendering a quad which is completely transparent at the top with the texture applied with moving coordinates? Then you can use the somewhat more standard blend function of glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) to get the exact same thing on any background.[EDIT]Make that a polygon with 6 vertices that's completely transparent on the top and bottom, but completely opaque in the middle.   ;  The text is a separate quad and the background gradient is a separate quad.. the background has a gradient applied to it and each word of text is a separate quad.. i have to do this is as the text is moving across the screen.. so i cant just simply apply it over a quad..   ;  Maybe you can do it in 2 passes then, and render the text to a texture, then redraw that texture over the polygon I mentioned...[EDIT]Just re-read the topic. Only other way I can think of would be to create a large texture and re-fill the texture data with the image data of the names every time you want something moved... Probably not the best way of going about it though...[Edited by - Gorax on May 19, 2010 3:43:22 AM];  Multi-texturing and a shader. The shader can't do the blending, but you can use your gradient to adjust the alpha values of your text before it does an alpha blend onto the background.So - draw the background gradient as you need,bind the text texture and background gradient,use a shader that multiplies the text alpha by the gradient level (or alpha). You might be able to use two sets of tex co-ords, or if the gradient is always filling the viewport, use the gl_FragCoord to sample the gradient texture.BrucePS - let me know if it works, I need to do similar next week!   ;  Thankyou everyone for your responses..Gorax i can do it normally with two passes.. and i already thought about rendering the  text to a texture and then apllying that as a texture to a quad with alpha values.. but the device im using doesnt suport fbo's so i will have to take the longer and slower way for rtt which im pretty sure is equal to the 2 passes method.. and yea the second method would run liek the 2 pass method too..Bruce, im using gles 1.1.. i wish i could use a shader..   ;  You could use combiner...that always works for me.   