RGBA texture

Started by pitt, January 16, 2006, 06:04:52 AM

Previous topic - Next topic

pitt

Hi. The Texture can accept only 24bpp(RGB, right?) bitmap. I want the alpha channel to render some effect like smoke, fire in OpenGL. Object3D.setTranspanrency just set the same alpha value throughout the face that not good enough. Creating many faces with different transpanrency valve to represent as 1 face is not acceptable too. How can I? Thank you very much.

EgonOlsen

You can't, i'm afraid. The current version has no way to add an alpha channel to a texture. As you have already mentioned, the only alpha texture there is, is the one implicitly created when enabling transparency on an object.
enabling transparency will automatically render all texels below 0x000f0f0f as invisible. Isn't that enough for the effects you described?

pitt

:( I really need it.

I think GL11.glTexImage2D with GL_RGBA can handle the alpha channel.
Right?

How can I create a texture object with this function?

EgonOlsen

Quote from: "pitt":( I really need it.

I think GL11.glTexImage2D with GL_RGBA can handle the alpha channel.
Right?
Of course it can and jPCT already uses this. It just wasn't accessible because the software renderer doesn't support it and the renderers were meant to be equally powerfull (or -less in that matter). But i've added so many GL-only features lately that it doesn't really matter anymore. So here is the latest beta with additional constructors in Texture that support the alpha channel if the loaded image provides one.

http://www.jpct.net/download/beta/jpctapi110_pre3.zip

Hope this helps!

pitt