View Full Version : Transparency
i just want to make some parts of a polygon complete transparent (cliping ?).
my problem is, that the transparent parts are always a little bit darker than the background. is this normal ? cant i get rid of the "shaddows" ?
10-18-2003, 03:49 AM
What kind of BlendFunction do you use ?
first i enable BL_BLEND;
then i paint the first quad
then i change the
and paint the next Quad on the same position.
after that i disable the Blend and DepthTest.
if it is important: i use loaded "tga" and its on a 2D environment.
is there something wrong with it ?
Hmm. It appears you are trying to mask out all the black pixels in the texture. If that's the case, make sure your tga file is in fact using black, and not using alpha transparency. If it is using alpha transparency, then either using an alpha test (instead of the blending) or fix the file.
i'm not shure this will work!
so maybe this: glBlendFunc(GL_SRC_COLOR, GL_DST_COLOR);
if your texture has alpha channel do this like:
glAplhaFunc(GL_LESS, 0.5f); // discard all fragments which alpha value is lesser than 0.5
okay, i'll try this this afternoon.
the tga is a uncompressed tga. the color is RGB and its "real" black (0,0,0).
it worked. now i used tga with alpha. there was no problem with it. thanks :-)
can anyone tell me how to load tgas or bmps in any size ?
what do you mean in "...load tgas..."?
if you mean load them to gl then:
use gluBuild2DMipmaps to use not square-sized textures
or use glTexImage with GL_TEXTURE_RECTANGLE_NV... or rescale image by hand
[This message has been edited by gvm (edited 10-21-2003).]
yes that i mean. i will look for this :-)
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.