Author Topic: Cube mapping and transparecny  (Read 1066 times)

Offline yindroid

  • byte
  • *
  • Posts: 21
    • View Profile
Cube mapping and transparecny
« on: January 02, 2012, 08:55:16 pm »
Hi everyone!
I would like to know, is there any way how to make texture semi-transparent if using cubemapping?
this is my code:
Code: [Select]
//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
« Last Edit: January 03, 2012, 04:41:04 pm by yindroid »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Cube mapping and transparecny
« Reply #1 on: January 03, 2012, 08:55:44 pm »
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:

Code: [Select]
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.

Offline yindroid

  • byte
  • *
  • Posts: 21
    • View Profile
Re: Cube mapping and transparecny
« Reply #2 on: January 04, 2012, 01:30:05 am »
well... when I use setEnvmapped(Object3D.ENVMAP_ENABLED); then transparency is no longer working ... thats is my problem :(

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Cube mapping and transparecny
« Reply #3 on: January 04, 2012, 09:00:15 pm »
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...

Offline yindroid

  • byte
  • *
  • Posts: 21
    • View Profile
Re: Cube mapping and transparecny
« Reply #4 on: January 05, 2012, 03:30:01 pm »
ok, thx Egon