glClearColor Alpha Value

Started by
3 comments, last by Undeadlnsanity 18 years, 6 months ago
Quick question that should be easy for you openGL gurus -- What does the alpha value in glClearColor do, and how will it effect my drawing? Thanks.
Advertisement
glClearColor specifies the values used when the colour buffer is cleared.

If the alpha value was set to 0 it would be completely transparent, but if it was set to 1 it would be opaque. There's not much use to the alpha value unless you use special effects such as translucency, so it's best to set it to 1.0 if you don't.
Can you give me some examples of how it might be used?
Thanks for the info!
It gives the framebuffer an alpha value. So you can use it with say, GL_DST_ALPHA in glBlendFunc
Transparent:
glClearColor(0.0, 0.0, 0.0, 0.0);


Opaque:
glClearColor(0.0, 0.0, 0.0, 1.0);

This topic is closed to new replies.

Advertisement