I am trying to figure out how to make the color of like the bight pinkish/purplish color transparent using open GL and C++ anyone know how to set this up? Or the basic commands of making it trasparent?
coder requires 0xf00d before continue().
Killer Eagle Software
Making a certain color see though?
You need to add an alpha channel (almost all art programs can do this) to your texture and then use an alpha test (glAlphaFunc).
colors are stored as color components on a PC... for example, the pixels you see with bitmaps and such have a RED, GREEN, and BLUE channel (the values of these channels blend to form all the colors available).
some graphics file formats (and textures in OGL) have an ALPHA channel also, which is another channel that determines how transparent that pixel is.
by adding an alpha channel to your graphics, you can have parts be clear, or slightly see-through.
hope that helps.
PS - if you only want to have some parts completely clear, and the rest regular, you can also use MASKING instead of the alpha stuff, see the tutorials on nehe.gamedev.net to see how to do this.
some graphics file formats (and textures in OGL) have an ALPHA channel also, which is another channel that determines how transparent that pixel is.
by adding an alpha channel to your graphics, you can have parts be clear, or slightly see-through.
hope that helps.
PS - if you only want to have some parts completely clear, and the rest regular, you can also use MASKING instead of the alpha stuff, see the tutorials on nehe.gamedev.net to see how to do this.
Check out NeHe''s Blending tutorial:
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=08
Or look up "Alpha Blending" in google.
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=08
Or look up "Alpha Blending" in google.
glColor4f(1.0f,1.0f,1.0f,0.5f);
glBlendFunc(GL_SRC_ALPHA,GL_ONE);
is this how blending is done and glColor4 the 4th is the alpha value and the blend function I am completely lost on.... But its not that i want to blend the whole thing just a specific color im lost :/ lol
coder requires 0xf00d before continue().
Killer Eagle Software
glBlendFunc(GL_SRC_ALPHA,GL_ONE);
is this how blending is done and glColor4 the 4th is the alpha value and the blend function I am completely lost on.... But its not that i want to blend the whole thing just a specific color im lost :/ lol
coder requires 0xf00d before continue().
Killer Eagle Software
just found this old topic and i d still know if it is possible to get rid of one specific color
maybe an extension or what ever
any idea?
maybe an extension or what ever
any idea?
quote:Original post by Basiror
just found this old topic and i d still know if it is possible to get rid of one specific color
maybe an extension or what ever
any idea?
Write a loader that inserts a fourth channel into the image and set the value of the fourth channel to zero when the RGB color a pixel is equal to the color you wish you set transparent. You''ll want to check the syntax you use to register your texture with OpenGL to ensure that it recognizes that the image contains an alpha channel, and you need to turn on certain settings when rendering while using the texture in order to utilize the transparency - I believe that is accomplished with alpha testing.
That "bright pinkish/purplish" color is known as Magenta. For your information, magenta is the highest possible combination of red and blue, Cyan is the highest possible combination of blue and green, and Yellow is the highest possible combination of red and green.
"Last time, I asked: ''What does mathematics mean to you?'' And some people answered: ''The manipulation of numbers, the manipulation of structures.'' And if I had asked what music means to you, would you have answered: ''The manipulation of notes?''" - S. Lang
actually i was asking for a renderwise solution
if i d write such a loader it write a convertor and spare some time while loading maps ...
if i d write such a loader it write a convertor and spare some time while loading maps ...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement