Author Topic: RGBA texture  (Read 3666 times)

pitt

  • Guest
RGBA texture
« on: January 16, 2006, 06:04:52 am »
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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
RGBA texture
« Reply #1 on: January 16, 2006, 05:08:57 pm »
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

  • Guest
RGBA texture
« Reply #2 on: January 16, 2006, 06:10:50 pm »
:( 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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
RGBA texture
« Reply #3 on: January 16, 2006, 08:22:22 pm »
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

  • Guest
RGBA texture
« Reply #4 on: January 17, 2006, 02:59:06 am »
:D
Thank you.