Re: [PyOpenGL-Users] problems with transparency
Brought to you by:
mcfletch
From: Erik J. <ejo...@fa...> - 2006-09-26 20:32:50
|
On Tue, 26 Sep 2006 21:02:04 +0200, "altern" <al...@gm...> said: > hi > > i am trying to get transparency with some png images that have alpha > channel. But i just get to see the alpha channel itself. I mean i get > the transparency but the image is black, like all colors but the > transparency have been deleted. That's a strange problem. Do you have something like: glEnable(GL_TEXTURE_2D) glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) in your initialization? Another thing you could try is replacing: gluBuild2DMipmaps(GL_TEXTURE_2D, 4, w, h, GL_RGBA, GL_UNSIGNED_BYTE, bin) with: glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, bin) I've used mipmaps in the past, but I don't have the code readily available. if you are still having problems, you could look at this: http://disruption.ca/gutil/example2/example2a.html Erik |