How to programmatically alpha fade a textured object in OpenGL ES 1.1 (iPhone)

Posted by PewterSoft on Stack Overflow See other posts from Stack Overflow or by PewterSoft
Published on 2009-10-15T12:52:32Z Indexed on 2010/04/03 21:23 UTC
Read the original article Hit count: 398

Filed under:
|
|
|
|

I've been using OpenGL ES 1.1 on the iPhone for 10 months, and in that time there is one seemingly simple task I have been unable to do: programmatically fade a textured object. To keep it simple: how can I alpha fade, under code control, a simple 2D triangle that has a texture (with alpha) applied to it. I would like to fade it in/out while it is over a scene, not a simple colored background. So far the only technique I have to do this is to create a texture with multiple pre-faded copies of the texture on it. (Yuck)

As an example, I am unable to do this using Apple's GLSprite sample code as a starting point. It already textures a quad with a texture that has its own alpha. I would like to fade that object in and out.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about opengl