Cube mapping and transparecny

Started by yindroid, January 02, 2012, 08:55:16 PM

Previous topic - Next topic

yindroid

Hi everyone!
I would like to know, is there any way how to make texture semi-transparent if using cubemapping?
this is my code:

//for interval 0..255
Config.glTransparencyMul = 0.0039f;
Config.glTransparencyOffset = 0f;

TextureManager tm = TextureManager.getInstance();
tm.addTexture("glass", new Texture(mUtils.getScaledBitmapFromAssets(256,256,"gfx/glass.jpg", AppContext), true));
Glass.setTexture("glass");
Glass.setEnvmapped(Object3D.ENVMAP_ENABLED);
Glass.setEllipsoidMode(Object3D.ELLIPSOID_ALIGNED);
Glass.setTransparency(100);

p.s. works without using cubemapping!
Thanks in advance

EgonOlsen

There's no support for cube mapping, so i'm not sure what exactly you are talking about...do you have a screen shot that shows what you mean?

BTW, this:


Glass.setEllipsoidMode(Object3D.ELLIPSOID_ALIGNED);


Makes no sense in this context. It's a setting for collision detection. It has nothing to do with transparency or texturing. You can simply remove that line.

yindroid

well... when I use setEnvmapped(Object3D.ENVMAP_ENABLED); then transparency is no longer working ... thats is my problem :(

EgonOlsen

Transparency has nothing to do with environment mapping. However, the environment mapping implementation of jPCT-AE isn't very good. Because IOpenGL ES itself doesn't provide this feature, i'm trying to mimic it by using a tweaked texture matrix, but the results aren't very good. Chance is, that in your case, the transparent parts of the texture just aren't visible because the implementation creates a rather bad looking result in your case. Honestly, i suggest not to use environment mapping at all...