Author Topic: texture is faded after Object3D.setTransparent  (Read 1835 times)

Offline guillaume

  • int
  • **
  • Posts: 67
    • View Profile
texture is faded after Object3D.setTransparent
« on: December 23, 2011, 01:45:46 am »
please see the attachement. I want to let the icon's black background
be transparent,  and do a setTransparent(0) on the icon. the result
is the icon seems faded than before, how can I keep it as before ?
thanks.

[attachment deleted by admin]

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12092
    • View Profile
    • http://www.jpct.net
Re: texture is faded after Object3D.setTransparent
« Reply #1 on: December 23, 2011, 09:51:30 am »
Increase the transparency value...maybe to 20 or something and use the default blending mode (i.e. not additive). That should leave the black areas transparent and the icon more or less opaque.

Offline guillaume

  • int
  • **
  • Posts: 67
    • View Profile
Re: texture is faded after Object3D.setTransparent
« Reply #2 on: December 26, 2011, 01:38:29 am »
thanks. I have tried it. now the icon looks better.

Offline guillaume

  • int
  • **
  • Posts: 67
    • View Profile
Re: texture is faded after Object3D.setTransparent [ new problem ]
« Reply #3 on: December 29, 2011, 08:18:41 am »
after setTransparent, my texture seems distorted. see the attachment.
after Object3D.setTransparencyMode(Object3D.TRANSPARENCY_MODE_DEFAULT);
       Object3D.setTransparency(20);  the upper right of the recyclebin looks dirty.
how can I make it look as the same as I view it in picture viewers ?  thanks

[attachment deleted by admin]

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12092
    • View Profile
    • http://www.jpct.net
Re: texture is faded after Object3D.setTransparent
« Reply #4 on: December 29, 2011, 02:14:41 pm »
Which constructor are you using for your Textures? If they provide a proper alpha channel in the png-file, use the new Texture(<....>, true); variant and see if that helps.

Offline guillaume

  • int
  • **
  • Posts: 67
    • View Profile
Re: texture is faded after Object3D.setTransparent
« Reply #5 on: December 30, 2011, 01:36:32 am »
Yes. thank you. I just not  use the constructor with useAlpha parameter, now it looks ok. :)