Original Post
I am writing a quad based 2D graphics engine, using Andy Pikes tutorials as a base. There are many circumstances in my game where it would be useful to change the transperancy of a panel on the fly. I have read in many places that it is bad practice to reach into the vertex buffer and change the transperancy values there, so I have been resorting to a fairly sloppy technique: I create 255 different quads of size 2 * 2 on startup, each with an alpha value between 0 and 255 applied to all vertices. When it is time to render a panel, the application checks the current transperancy of the panel and selects the appropriate quad, scales and rotates it to the appropriate dimensions for the panel, sets the texture, and renders. This works absolutely fine in 2D where only quads are used, but doesn't seem like very good practice. It also wouldn't work when I move onto 3D, as it would be horribly innefficient to make 255 copies of complex meshes. Is it possible to change the alpha values of an object on the fly without manipulating the vertex buffer? I already know how to apply a RGB tint to my quads, but the same technique doesn't seem to work for alpha.