Author Topic: Object3D.setTextureMatrix() issue?  (Read 749 times)

Offline tao

  • byte
  • *
  • Posts: 16
    • View Profile
Object3D.setTextureMatrix() issue?
« on: April 12, 2014, 10:28:02 am »
Hi,

I put multiple textures into one texture, and using setTextureMatrix() to play frame animations. The animations works fine, but seems the semi-transparency pixels on original texture becomes fully opaque when it rendered to screen. Can anyone help? Thanks.

Offline Lobby

  • int
  • **
  • Posts: 66
    • View Profile
    • flowersoft
Re: Object3D.setTextureMatrix() issue?
« Reply #1 on: April 13, 2014, 10:38:10 am »
Have you loaded the texture with flag alpha true? Does the transparency work if you don't apply a texture matrix?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Object3D.setTextureMatrix() issue?
« Reply #2 on: April 13, 2014, 07:01:12 pm »
I fail to see any relation to the texture matrix. But the blending between textures also affects the alpha channel. So if you add them for example, the alpha channel of the second texture will be added to the first texture. If you don't want this, you either have to use some clever combination of blending modes or use OpenGL ES 2.0 and write your own shader that ignores the second alpha channel.

Offline tao

  • byte
  • *
  • Posts: 16
    • View Profile
Re: Object3D.setTextureMatrix() issue?
« Reply #3 on: April 14, 2014, 03:37:58 am »
 ;D My fault ... forgot to set "true" in new Texture().