OpenGL Terminolgy and Quake 3 HUD

Started by
4 comments, last by iNsAn1tY 18 years, 9 months ago
I was wondering what is the effect that the Quake 3 HUD, as seen here, is called for the semi-transparent bluish part of the HUD? Is it alpha, transparency, or translucency? Right now I have my code so I can make a HUD similar to that, I just don't know what functions to look into to make that effect. I have the code that takes my color key out of the HUD, for my case a near black color, (0,0,1 or something like that) and that looks like this:

glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
Now, I just need to figure out what to do to make elements semi-transparent as seen in the example so the HUD does not block *everything*. I've noticed I can't mix effects either, only the last effect is used with the blending as well. Thanks for any help!
Advertisement
Quote:alpha, transparency, or translucency


Those are all sort of the same thing. 'Transparent' means it is basically invisible; 'Translucent' would be the area between Opague and Transparent. Alpha is just a means to encode that information.
just add an alpha channel to the texture set the transparent part of the channel to 0.2-0.8 (depending on how visable u want the stuff behind it) and set the metal tubing that surrounds the HUD part alpha to 1.0
btw (concerning another post here as well) forget totally about colorkeys in opengl, there is no need to use them
Ok cool, thanks for that explanation Deyja! Zedzeek, that's what I wanted to do, but I'm not sure how. Would I have to then have two textures for the GUI to be able to set the alpha channel that way? Right now I just have one big image I just draw to the screen, but I guess I need to split it up now? Thanks for the help.
Quote:Original post by Drew_Benton
Ok cool, thanks for that explanation Deyja! Zedzeek, that's what I wanted to do, but I'm not sure how. Would I have to then have two textures for the GUI to be able to set the alpha channel that way? Right now I just have one big image I just draw to the screen, but I guess I need to split it up now? Thanks for the help.

You don't necessarily need to split it up. Depends how you're drawing it. Are you doing it by blitting pixels, or with textured polygons? If it's with polygons, you just need to add an alpha channel to your image in the manner that zedzeek suggested. You'll need something like the GIMP, Paint Shop Pro or Photoshop to do it. I can PM you more detailed instructions for doing it in PSP if you want. You'll also need to save your texture in a file format that can support alpha channels. The Targa TGA format is excellent for this.
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]

This topic is closed to new replies.

Advertisement