www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: platte on March 08, 2012, 12:49:07 pm

Title: Constructor Texture(*, boolean useAlpha). useAlpha not work?
Post by: platte on March 08, 2012, 12:49:07 pm
Hi,  I have a png with alpha. when i use constructor of Texture(Bitmap, true). But the transparent is just black. But when I set the object3D's transparent to any NO zero value. It works. Why?. My code like these:

InputStream image = mContext.getResources().openRawResource(R.raw.test);
final Texture texture = new Texture(test, true);// useAlpha NOT work no matter whar true or false
TextureManager.getInstance().addTexture(mSceneGrass, texture);
Object3D[] objs = Loader.load3DS( LoadAssets.loadf(mContext, "test.3DS"), 1f);
objs[0].setTransparency(128);//it work
objs[0].setTexture(mSceneGrass);

When I remove objs[0].setTransparency(128);
The transparent is always black.

Thanks.
Title: Re: Constructor Texture(*, boolean useAlpha). useAlpha not work?
Post by: EgonOlsen on March 08, 2012, 06:42:43 pm
That's by design...an alpha can't have an effect if blending isn't enabled. And that is done by calling setTranspareny with any value other than -1.
Title: Re: Constructor Texture(*, boolean useAlpha). useAlpha not work?
Post by: platte on March 09, 2012, 01:44:06 am
Yes.I am newer.Thank for your answer.BTW:jPCT is really very cool.