OpenGL and alpha masks

Hey,

i have a problem. I would like to set an alpha mask to the whole screen and the mask should stay over all my linux apps like gnome, firefox and so on …

how can i do this? can anybody paste an short code? thx a lot
klaus

I have the same problem too. Is there any way to change the alpha value for the entire framebuffer?

Haven’t found any solution yet.

A number of solutions are possible given your somewhat vague description.

What do you want differently than what this gives you?:

glClearColor( 0,0,0, 0.12345 );
glClear( GL_COLOR_BUFFER_BIT );
glColorMask( GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE );

Specifically, what in your shading math do you want to work out differently?

Ok, i’ll try to explain it.

I’m working on my diploma thesis and i’m writing an application that can simulate graphics from a special embedded system on my pc. I’m using OpenGL for graphic functions, and so far everything worked fine except for one small problem.

In the embedded application, there is a function

fade( fadingvalue )

which basically multiplies every color pixel in the framebuffer with “fadingvalue”. This function is called repeatedly in a loop and so i can use it to fade the screen in or out.

My problem is that i don’t know how to do this in OpenGL. What i need is a way to multiply every pixel’s color and alpha value by a factor.

I already tried using glReadPixels and multiplying every pixel in a loop, but it slows the application down, so i would only use it if there is no alternative.

Multiplicative blending or alpha-blending, draw a black fullscreen quad with specified alpha.

Yes, that helped a lot.

Thanks.