Hi, I'm somewhat new to OpenGL. I've used it for extremely simple stuff like rendering Textures(2D) and basic MODELVIEW transformations, but now I want to modify the alpha values in fashion similar to the MODELVIEW stack.
I basically have a glTex class, which renders a texture at a certain point after applying certain transformations to it. (Translation, Rotation, Alpha.) Now, this works fine for simple things like simple-images, but if I want to draw something a little more complex say a simple grid. I would translate to the required position of the grid, and then subsequently draw every part of it. This works fine cause I usually call glPushMatrix() and glPopMatrix() before and after rendering a texture.
The problem arises when I want to control the alhpa of the grid. Suppose I want to render it at 0.50 alpha. I could go through each of it's components and change their alpha values, but then this means that if some parts of the grid are made of smaller parts, they would have to do the same or if the smaller parts them selves had alpha values I would have to calculate a brand new alpha, which turns into a really lengthy process.
Is there some way I could get an alpha stack like the MODELVIEW one ? Or is there any better way to go about it?
Example - Grid is rendered at 0.5 alpha. If it has a component which is normally rendered at 0.25 alpha, it will now be rendered at .125 alpha
Btw, I have the glBlendFunc set to GL _SRC _ALPHA and GL _ONE _MINUS _SRC _ALPHA.